about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/command/command.c44
-rw-r--r--src/command/commands.h2
-rw-r--r--src/ui/console.c303
-rw-r--r--src/ui/core.c352
-rw-r--r--src/ui/inputwin.c45
-rw-r--r--src/ui/notifier.c42
-rw-r--r--src/ui/statusbar.c60
-rw-r--r--src/ui/titlebar.c45
-rw-r--r--src/ui/ui.h341
-rw-r--r--tests/test_cmd_account.c9
-rw-r--r--tests/test_cmd_connect.c18
-rw-r--r--tests/ui/mock_ui.c324
-rw-r--r--tests/ui/mock_ui.h13
13 files changed, 793 insertions, 805 deletions
diff --git a/src/command/command.c b/src/command/command.c
index a13687a3..e37331ce 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -435,7 +435,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/beep",
-        cmd_beep, parse_args, 1, 1, cons_beep_setting,
+        cmd_beep, parse_args, 1, 1, &cons_beep_setting,
         { "/beep on|off", "Terminal beep on new messages.",
         { "/beep on|off",
           "------------",
@@ -445,7 +445,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/notify",
-        cmd_notify, parse_args, 2, 2, cons_notify_setting,
+        cmd_notify, parse_args, 2, 2, &cons_notify_setting,
         { "/notify type value", "Control various desktop noficiations.",
         { "/notify type value",
           "------------------",
@@ -470,7 +470,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/flash",
-        cmd_flash, parse_args, 1, 1, cons_flash_setting,
+        cmd_flash, parse_args, 1, 1, &cons_flash_setting,
         { "/flash on|off", "Terminal flash on new messages.",
         { "/flash on|off",
           "-------------",
@@ -480,7 +480,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/intype",
-        cmd_intype, parse_args, 1, 1, cons_intype_setting,
+        cmd_intype, parse_args, 1, 1, &cons_intype_setting,
         { "/intype on|off", "Show when contact is typing.",
         { "/intype on|off",
           "--------------",
@@ -488,7 +488,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/splash",
-        cmd_splash, parse_args, 1, 1, cons_splash_setting,
+        cmd_splash, parse_args, 1, 1, &cons_splash_setting,
         { "/splash on|off", "Splash logo on startup and /about command.",
         { "/splash on|off",
           "--------------",
@@ -496,7 +496,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/autoconnect",
-        cmd_autoconnect, parse_args, 1, 2, cons_autoconnect_setting,
+        cmd_autoconnect, parse_args, 1, 2, &cons_autoconnect_setting,
         { "/autoconnect set|off [account]", "Set account to autoconnect with.",
         { "/autoconnect set|off [account]",
           "------------------------------",
@@ -517,7 +517,7 @@ static struct cmd_t command_defs[] =
           NULL  } } },
 
     { "/titlebar",
-        cmd_titlebar, parse_args, 2, 2, cons_titlebar_setting,
+        cmd_titlebar, parse_args, 2, 2, &cons_titlebar_setting,
         { "/titlebar property on|off", "Show various properties in the window title bar.",
         { "/titlebar property on|off",
           "-------------------------",
@@ -526,7 +526,7 @@ static struct cmd_t command_defs[] =
           NULL  } } },
 
     { "/mouse",
-        cmd_mouse, parse_args, 1, 1, cons_mouse_setting,
+        cmd_mouse, parse_args, 1, 1, &cons_mouse_setting,
         { "/mouse on|off", "Use profanity mouse handling.",
         { "/mouse on|off",
           "-------------",
@@ -539,7 +539,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/chlog",
-        cmd_chlog, parse_args, 1, 1, cons_chlog_setting,
+        cmd_chlog, parse_args, 1, 1, &cons_chlog_setting,
         { "/chlog on|off", "Chat logging to file",
         { "/chlog on|off",
           "-------------",
@@ -550,7 +550,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/grlog",
-        cmd_grlog, parse_args, 1, 1, cons_grlog_setting,
+        cmd_grlog, parse_args, 1, 1, &cons_grlog_setting,
         { "/grlog on|off", "Chat logging of chat rooms to file",
         { "/grlog on|off",
           "-------------",
@@ -559,7 +559,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/states",
-        cmd_states, parse_args, 1, 1, cons_states_setting,
+        cmd_states, parse_args, 1, 1, &cons_states_setting,
         { "/states on|off", "Send chat states during a chat session.",
         { "/states on|off",
           "--------------",
@@ -568,7 +568,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/outtype",
-        cmd_outtype, parse_args, 1, 1, cons_outtype_setting,
+        cmd_outtype, parse_args, 1, 1, &cons_outtype_setting,
         { "/outtype on|off", "Send typing notification to recipient.",
         { "/outtype on|off",
           "---------------",
@@ -577,7 +577,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/gone",
-        cmd_gone, parse_args, 1, 1, cons_gone_setting,
+        cmd_gone, parse_args, 1, 1, &cons_gone_setting,
         { "/gone minutes", "Send 'gone' state to recipient after a period.",
         { "/gone minutes",
           "-------------",
@@ -588,7 +588,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/history",
-        cmd_history, parse_args, 1, 1, cons_history_setting,
+        cmd_history, parse_args, 1, 1, &cons_history_setting,
         { "/history on|off", "Chat history in message windows.",
         { "/history on|off",
           "---------------",
@@ -597,7 +597,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/log",
-        cmd_log, parse_args, 2, 2, cons_log_setting,
+        cmd_log, parse_args, 2, 2, &cons_log_setting,
         { "/log maxsize value", "Manage system logging settings.",
         { "/log maxsize value",
           "------------------",
@@ -606,7 +606,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/reconnect",
-        cmd_reconnect, parse_args, 1, 1, cons_reconnect_setting,
+        cmd_reconnect, parse_args, 1, 1, &cons_reconnect_setting,
         { "/reconnect seconds", "Set reconnect interval.",
         { "/reconnect seconds",
           "------------------",
@@ -615,7 +615,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/autoping",
-        cmd_autoping, parse_args, 1, 1, cons_autoping_setting,
+        cmd_autoping, parse_args, 1, 1, &cons_autoping_setting,
         { "/autoping seconds", "Server ping interval.",
         { "/autoping seconds",
           "-----------------",
@@ -624,7 +624,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/autoaway",
-        cmd_autoaway, parse_args_with_freetext, 2, 2, cons_autoaway_setting,
+        cmd_autoaway, parse_args_with_freetext, 2, 2, &cons_autoaway_setting,
         { "/autoaway setting value", "Set auto idle/away properties.",
         { "/autoaway setting value",
           "-----------------------",
@@ -645,7 +645,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/priority",
-        cmd_priority, parse_args, 1, 1, cons_priority_setting,
+        cmd_priority, parse_args, 1, 1, &cons_priority_setting,
         { "/priority value", "Set priority for the current account.",
         { "/priority value",
           "---------------",
@@ -714,7 +714,7 @@ static struct cmd_t command_defs[] =
           NULL } } },
 
     { "/theme",
-        cmd_theme, parse_args, 1, 2, cons_theme_setting,
+        cmd_theme, parse_args, 1, 2, &cons_theme_setting,
         { "/theme command [theme-name]", "Change colour theme.",
         { "/theme command [theme-name]",
           "---------------------------",
@@ -730,7 +730,7 @@ static struct cmd_t command_defs[] =
 
 
     { "/statuses",
-        cmd_statuses, parse_args, 1, 1, cons_statuses_setting,
+        cmd_statuses, parse_args, 1, 1, &cons_statuses_setting,
         { "/statuses on|off", "Set notifications for status messages.",
         { "/statuses on|off",
           "----------------",
@@ -1086,7 +1086,7 @@ cmd_execute(const char * const command, const char * const inp)
         gchar **args = cmd->parser(inp, cmd->min_args, cmd->max_args);
         if ((args == NULL) && (cmd->setting_func != NULL)) {
             cons_show("");
-            cmd->setting_func();
+            (*cmd->setting_func)();
             cons_show("Usage: %s", cmd->help.usage);
             return TRUE;
         } else if (args == NULL) {
diff --git a/src/command/commands.h b/src/command/commands.h
index aee74849..27a02249 100644
--- a/src/command/commands.h
+++ b/src/command/commands.h
@@ -46,7 +46,7 @@ typedef struct cmd_t {
     gchar** (*parser)(const char * const inp, int min, int max);
     int min_args;
     int max_args;
-    void (*setting_func)(void);
+    void (**setting_func)(void);
     CommandHelp help;
 } Command;
 
diff --git a/src/ui/console.c b/src/ui/console.c
index 43313dd1..57e5eb73 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -47,24 +47,26 @@
 static void _cons_splash_logo(void);
 void _show_roster_contacts(GSList *list, gboolean show_groups);
 
-void
-cons_show_time(void)
+static void
+_cons_show_time(void)
 {
     ProfWin *console = wins_get_console();
     win_print_time(console, '-');
     wins_refresh_console();
 }
+void (*cons_show_time)(void) = _cons_show_time;
 
-void
-cons_show_word(const char * const word)
+static void
+_cons_show_word(const char * const word)
 {
     ProfWin *console = wins_get_console();
     wprintw(console->win, "%s", word);
     wins_refresh_console();
 }
+void (*cons_show_word)(const char * const) = _cons_show_word;
 
-void
-cons_debug(const char * const msg, ...)
+static void
+_cons_debug(const char * const msg, ...)
 {
     ProfWin *console = wins_get_console();
     if (strcmp(PACKAGE_STATUS, "development") == 0) {
@@ -84,6 +86,7 @@ cons_debug(const char * const msg, ...)
         ui_refresh();
     }
 }
+void (*cons_debug)(const char * const, ...) = _cons_debug;
 
 static void
 _cons_show(const char * const msg, ...)
@@ -101,8 +104,8 @@ _cons_show(const char * const msg, ...)
 }
 void (*cons_show)(const char * const, ...) = _cons_show;
 
-void
-cons_show_error(const char * const msg, ...)
+static void
+_cons_show_error(const char * const msg, ...)
 {
     ProfWin *console = wins_get_console();
     va_list arg;
@@ -119,9 +122,10 @@ cons_show_error(const char * const msg, ...)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_error)(const char * const, ...) = _cons_show_error;
 
-void
-cons_show_typing(const char * const barejid)
+static void
+_cons_show_typing(const char * const barejid)
 {
     ProfWin *console = wins_get_console();
     PContact contact = roster_get_contact(barejid);
@@ -137,9 +141,10 @@ cons_show_typing(const char * const barejid)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_typing)(const char * const) = _cons_show_typing;
 
-void
-cons_show_incoming_message(const char * const short_from, const int win_index)
+static void
+_cons_show_incoming_message(const char * const short_from, const int win_index)
 {
     ProfWin *console = wins_get_console();
 
@@ -155,9 +160,10 @@ cons_show_incoming_message(const char * const short_from, const int win_index)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_incoming_message)(const char * const, const int) = _cons_show_incoming_message;
 
-void
-cons_about(void)
+static void
+_cons_about(void)
 {
     ProfWin *console = wins_get_console();
     int rows, cols;
@@ -207,9 +213,10 @@ cons_about(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_about)(void) = _cons_about;
 
-void
-cons_check_version(gboolean not_available_msg)
+static void
+_cons_check_version(gboolean not_available_msg)
 {
     ProfWin *console = wins_get_console();
     char *latest_release = release_get_latest();
@@ -238,9 +245,10 @@ cons_check_version(gboolean not_available_msg)
         }
     }
 }
+void (*cons_check_version)(gboolean) = _cons_check_version;
 
-void
-cons_show_login_success(ProfAccount *account)
+static void
+_cons_show_login_success(ProfAccount *account)
 {
     ProfWin *console = wins_get_console();
     win_print_time(console, '-');
@@ -258,9 +266,10 @@ cons_show_login_success(ProfAccount *account)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_login_success)(ProfAccount*) = _cons_show_login_success;
 
-void
-cons_show_wins(void)
+static void
+_cons_show_wins(void)
 {
     ProfWin *console = wins_get_console();
     cons_show("");
@@ -279,9 +288,10 @@ cons_show_wins(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_wins)(void) = _cons_show_wins;
 
-void
-cons_show_room_invites(GSList *invites)
+static void
+_cons_show_room_invites(GSList *invites)
 {
     cons_show("");
     if (invites == NULL) {
@@ -297,9 +307,10 @@ cons_show_room_invites(GSList *invites)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_room_invites)(GSList*) = _cons_show_room_invites;
 
-void
-cons_show_info(PContact pcontact)
+static void
+_cons_show_info(PContact pcontact)
 {
     ProfWin *console = wins_get_console();
     const char *barejid = p_contact_barejid(pcontact);
@@ -430,9 +441,10 @@ cons_show_info(PContact pcontact)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_info)(PContact) = _cons_show_info;
 
-void
-cons_show_caps(const char * const contact, Resource *resource)
+static void
+_cons_show_caps(const char * const contact, Resource *resource)
 {
     ProfWin *console = wins_get_console();
     WINDOW *win = console->win;
@@ -505,9 +517,10 @@ cons_show_caps(const char * const contact, Resource *resource)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_caps)(const char * const, Resource*) = _cons_show_caps;
 
-void
-cons_show_software_version(const char * const jid, const char * const  presence,
+static void
+_cons_show_software_version(const char * const jid, const char * const  presence,
     const char * const name, const char * const version, const char * const os)
 {
     ProfWin *console = wins_get_console();
@@ -532,9 +545,12 @@ cons_show_software_version(const char * const jid, const char * const  presence,
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_software_version)(const char * const, const char * const,
+    const char * const, const char * const,
+    const char * const) = _cons_show_software_version;
 
-void
-cons_show_received_subs(void)
+static void
+_cons_show_received_subs(void)
 {
     GSList *received = presence_get_subscription_requests();
     if (received == NULL) {
@@ -552,9 +568,10 @@ cons_show_received_subs(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_received_subs)(void) = _cons_show_received_subs;
 
-void
-cons_show_sent_subs(void)
+static void
+_cons_show_sent_subs(void)
 {
    if (roster_has_pending_subscriptions()) {
         GSList *contacts = roster_get_contacts();
@@ -574,9 +591,10 @@ cons_show_sent_subs(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_sent_subs)(void) = _cons_show_sent_subs;
 
-void
-cons_show_room_list(GSList *rooms, const char * const conference_node)
+static void
+_cons_show_room_list(GSList *rooms, const char * const conference_node)
 {
     ProfWin *console = wins_get_console();
     if ((rooms != NULL) && (g_slist_length(rooms) > 0)) {
@@ -598,9 +616,10 @@ cons_show_room_list(GSList *rooms, const char * const conference_node)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_room_list)(GSList*, const char * const) = _cons_show_room_list;
 
-void
-cons_show_bookmarks(const GList *list)
+static void
+_cons_show_bookmarks(const GList *list)
 {
     Bookmark *item;
 
@@ -628,9 +647,10 @@ cons_show_bookmarks(const GList *list)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_bookmarks)(const GList*) = _cons_show_bookmarks;
 
-void
-cons_show_disco_info(const char *jid, GSList *identities, GSList *features)
+static void
+_cons_show_disco_info(const char *jid, GSList *identities, GSList *features)
 {
     if (((identities != NULL) && (g_slist_length(identities) > 0)) ||
         ((features != NULL) && (g_slist_length(features) > 0))) {
@@ -671,9 +691,10 @@ cons_show_disco_info(const char *jid, GSList *identities, GSList *features)
         cons_alert();
     }
 }
+void (*cons_show_disco_info)(const char*, GSList*, GSList*) = _cons_show_disco_info;
 
-void
-cons_show_disco_items(GSList *items, const char * const jid)
+static void
+_cons_show_disco_items(GSList *items, const char * const jid)
 {
     ProfWin *console = wins_get_console();
     if ((items != NULL) && (g_slist_length(items) > 0)) {
@@ -696,9 +717,10 @@ cons_show_disco_items(GSList *items, const char * const jid)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_disco_items)(GSList*, const char * const) = _cons_show_disco_items;
 
-void
-cons_show_status(const char * const barejid)
+static void
+_cons_show_status(const char * const barejid)
 {
     ProfWin *console = wins_get_console();
     PContact pcontact = roster_get_contact(barejid);
@@ -711,9 +733,10 @@ cons_show_status(const char * const barejid)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_status)(const char * const) = _cons_show_status;
 
-void
-cons_show_room_invite(const char * const invitor, const char * const room,
+static void
+_cons_show_room_invite(const char * const invitor, const char * const room,
     const char * const reason)
 {
     char *display_from = NULL;
@@ -748,9 +771,11 @@ cons_show_room_invite(const char * const invitor, const char * const room,
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_room_invite)(const char * const, const char * const,
+    const char * const) = _cons_show_room_invite;
 
-void
-cons_show_account_list(gchar **accounts)
+static void
+_cons_show_account_list(gchar **accounts)
 {
     ProfWin *console = wins_get_console();
     int size = g_strv_length(accounts);
@@ -778,9 +803,10 @@ cons_show_account_list(gchar **accounts)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_account_list)(gchar**) = _cons_show_account_list;
 
-void
-cons_show_account(ProfAccount *account)
+static void
+_cons_show_account(ProfAccount *account)
 {
     ProfWin *console = wins_get_console();
     cons_show("");
@@ -901,9 +927,10 @@ cons_show_account(ProfAccount *account)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_account)(ProfAccount*) = _cons_show_account;
 
-void
-cons_theme_setting(void)
+static void
+_cons_theme_setting(void)
 {
     gchar *theme = prefs_get_string(PREF_THEME);
     if (theme == NULL) {
@@ -912,72 +939,80 @@ cons_theme_setting(void)
         cons_show("Theme (/theme)               : %s", theme);
     }
 }
+void (*cons_theme_setting)(void) = _cons_theme_setting;
 
-void
-cons_beep_setting(void)
+static void
+_cons_beep_setting(void)
 {
     if (prefs_get_boolean(PREF_BEEP))
         cons_show("Terminal beep (/beep)        : ON");
     else
         cons_show("Terminal beep (/beep)        : OFF");
 }
+void (*cons_beep_setting)(void) = _cons_beep_setting;
 
-void
-cons_flash_setting(void)
+static void
+_cons_flash_setting(void)
 {
     if (prefs_get_boolean(PREF_FLASH))
         cons_show("Terminal flash (/flash)      : ON");
     else
         cons_show("Terminal flash (/flash)      : OFF");
 }
+void (*cons_flash_setting)(void) = _cons_flash_setting;
 
-void
-cons_splash_setting(void)
+static void
+_cons_splash_setting(void)
 {
     if (prefs_get_boolean(PREF_SPLASH))
         cons_show("Splash screen (/splash)      : ON");
     else
         cons_show("Splash screen (/splash)      : OFF");
 }
+void (*cons_splash_setting)(void) = _cons_splash_setting;
 
-void
-cons_autoconnect_setting(void)
+static void
+_cons_autoconnect_setting(void)
 {
     if (prefs_get_string(PREF_CONNECT_ACCOUNT) != NULL)
         cons_show("Autoconnect (/autoconnect)      : %s", prefs_get_string(PREF_CONNECT_ACCOUNT));
     else
         cons_show("Autoconnect (/autoconnect)      : OFF");
 }
+void (*cons_autoconnect_setting)(void) = _cons_autoconnect_setting;
 
-void
-cons_vercheck_setting(void)
+static void
+_cons_vercheck_setting(void)
 {
     if (prefs_get_boolean(PREF_VERCHECK))
         cons_show("Version checking (/vercheck) : ON");
     else
         cons_show("Version checking (/vercheck) : OFF");
 }
+void (*cons_vercheck_setting)(void) = _cons_vercheck_setting;
 
-void
-cons_mouse_setting(void)
+static void
+_cons_mouse_setting(void)
 {
     if (prefs_get_boolean(PREF_MOUSE))
         cons_show("Mouse handling (/mouse)      : ON");
     else
         cons_show("Mouse handling (/mouse)      : OFF");
 }
+void (*cons_mouse_setting)(void) = _cons_mouse_setting;
 
-void
-cons_statuses_setting(void)
+static void
+_cons_statuses_setting(void)
 {
     if (prefs_get_boolean(PREF_STATUSES))
         cons_show("Status (/statuses)           : ON");
     else
         cons_show("Status (/statuses)           : OFF");
 }
+void (*cons_statuses_setting)(void) = _cons_statuses_setting;
 
-void
-cons_titlebar_setting(void)
+static void
+_cons_titlebar_setting(void)
 {
     if (prefs_get_boolean(PREF_TITLEBARVERSION)) {
         cons_show("Titlebar display (/titlebar) : version");
@@ -985,9 +1020,10 @@ cons_titlebar_setting(void)
         cons_show("Titlebar display (/titlebar) : NONE");
     }
 }
+void (*cons_titlebar_setting)(void) = _cons_titlebar_setting;
 
-void
-cons_show_ui_prefs(void)
+static void
+_cons_show_ui_prefs(void)
 {
     cons_show("UI preferences:");
     cons_show("");
@@ -1003,9 +1039,10 @@ cons_show_ui_prefs(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_ui_prefs)(void) = _cons_show_ui_prefs;
 
-void
-cons_notify_setting(void)
+static void
+_cons_notify_setting(void)
 {
     if (prefs_get_boolean(PREF_NOTIFY_MESSAGE))
         cons_show("Messages (/notify message)          : ON");
@@ -1036,9 +1073,10 @@ cons_notify_setting(void)
         cons_show("Reminder period (/notify remind)    : %d seconds", remind_period);
     }
 }
+void (*cons_notify_setting)(void) = _cons_notify_setting;
 
-void
-cons_show_desktop_prefs(void)
+static void
+_cons_show_desktop_prefs(void)
 {
     cons_show("Desktop notification preferences:");
     cons_show("");
@@ -1047,36 +1085,40 @@ cons_show_desktop_prefs(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_desktop_prefs)(void) = _cons_show_desktop_prefs;
 
-void
-cons_states_setting(void)
+static void
+_cons_states_setting(void)
 {
     if (prefs_get_boolean(PREF_STATES))
         cons_show("Send chat states (/states) : ON");
     else
         cons_show("Send chat states (/states) : OFF");
 }
+void (*cons_states_setting)(void) = _cons_states_setting;
 
-void
-cons_outtype_setting(void)
+static void
+_cons_outtype_setting(void)
 {
     if (prefs_get_boolean(PREF_OUTTYPE))
         cons_show("Send composing (/outtype)  : ON");
     else
         cons_show("Send composing (/outtype)  : OFF");
 }
+void (*cons_outtype_setting)(void) = _cons_outtype_setting;
 
-void
-cons_intype_setting(void)
+static void
+_cons_intype_setting(void)
 {
     if (prefs_get_boolean(PREF_INTYPE))
         cons_show("Show typing (/intype)      : ON");
     else
         cons_show("Show typing (/intype)      : OFF");
 }
+void (*cons_intype_setting)(void) = _cons_intype_setting;
 
-void
-cons_gone_setting(void)
+static void
+_cons_gone_setting(void)
 {
     gint gone_time = prefs_get_gone();
     if (gone_time == 0) {
@@ -1087,18 +1129,20 @@ cons_gone_setting(void)
         cons_show("Leave conversation (/gone) : %d minutes", gone_time);
     }
 }
+void (*cons_gone_setting)(void) = _cons_gone_setting;
 
-void
-cons_history_setting(void)
+static void
+_cons_history_setting(void)
 {
     if (prefs_get_boolean(PREF_HISTORY))
         cons_show("Chat history (/history)    : ON");
     else
         cons_show("Chat history (/history)    : OFF");
 }
+void (*cons_history_setting)(void) = _cons_history_setting;
 
-void
-cons_show_chat_prefs(void)
+static void
+_cons_show_chat_prefs(void)
 {
     cons_show("Chat preferences:");
     cons_show("");
@@ -1111,33 +1155,37 @@ cons_show_chat_prefs(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_chat_prefs)(void) = _cons_show_chat_prefs;
 
-void
-cons_log_setting(void)
+static void
+_cons_log_setting(void)
 {
     cons_show("Max log size (/log maxsize) : %d bytes", prefs_get_max_log_size());
 }
+void (*cons_log_setting)(void) = _cons_log_setting;
 
-void
-cons_chlog_setting(void)
+static void
+_cons_chlog_setting(void)
 {
     if (prefs_get_boolean(PREF_CHLOG))
         cons_show("Chat logging (/chlog)       : ON");
     else
         cons_show("Chat logging (/chlog)       : OFF");
 }
+void (*cons_chlog_setting)(void) = _cons_chlog_setting;
 
-void
-cons_grlog_setting(void)
+static void
+_cons_grlog_setting(void)
 {
     if (prefs_get_boolean(PREF_GRLOG))
         cons_show("Groupchat logging (/grlog)  : ON");
     else
         cons_show("Groupchat logging (/grlog)  : OFF");
 }
+void (*cons_grlog_setting)(void) = _cons_grlog_setting;
 
-void
-cons_show_log_prefs(void)
+static void
+_cons_show_log_prefs(void)
 {
     cons_show("Logging preferences:");
     cons_show("");
@@ -1148,9 +1196,10 @@ cons_show_log_prefs(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_log_prefs)(void) = _cons_show_log_prefs;
 
-void
-cons_autoaway_setting(void)
+static void
+_cons_autoaway_setting(void)
 {
     if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "off") == 0) {
         cons_show("Autoaway (/autoaway mode)            : OFF");
@@ -1173,9 +1222,10 @@ cons_autoaway_setting(void)
         cons_show("Autoaway check (/autoaway check)     : OFF");
     }
 }
+void (*cons_autoaway_setting)(void) = _cons_autoaway_setting;
 
-void
-cons_show_presence_prefs(void)
+static void
+_cons_show_presence_prefs(void)
 {
     cons_show("Presence preferences:");
     cons_show("");
@@ -1184,9 +1234,10 @@ cons_show_presence_prefs(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_presence_prefs)(void) = _cons_show_presence_prefs;
 
-void
-cons_reconnect_setting(void)
+static void
+_cons_reconnect_setting(void)
 {
     gint reconnect_interval = prefs_get_reconnect();
     if (reconnect_interval == 0) {
@@ -1197,9 +1248,10 @@ cons_reconnect_setting(void)
         cons_show("Reconnect interval (/reconnect) : %d seconds", reconnect_interval);
     }
 }
+void (*cons_reconnect_setting)(void) = _cons_reconnect_setting;
 
-void
-cons_autoping_setting(void)
+static void
+_cons_autoping_setting(void)
 {
     gint autoping_interval = prefs_get_autoping();
     if (autoping_interval == 0) {
@@ -1210,16 +1262,18 @@ cons_autoping_setting(void)
         cons_show("Autoping interval (/autoping)   : %d seconds", autoping_interval);
     }
 }
+void (*cons_autoping_setting)(void) = _cons_autoping_setting;
 
-void
-cons_priority_setting(void)
+static void
+_cons_priority_setting(void)
 {
     gint priority = prefs_get_priority();
     cons_show("Priority (/priority) : %d", priority);
 }
+void (*cons_priority_setting)(void) = _cons_priority_setting;
 
-void
-cons_show_connection_prefs(void)
+static void
+_cons_show_connection_prefs(void)
 {
     cons_show("Connection preferences:");
     cons_show("");
@@ -1230,9 +1284,10 @@ cons_show_connection_prefs(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_connection_prefs)(void) = _cons_show_connection_prefs;
 
-void
-cons_show_themes(GSList *themes)
+static void
+_cons_show_themes(GSList *themes)
 {
     cons_show("");
 
@@ -1249,9 +1304,10 @@ cons_show_themes(GSList *themes)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_themes)(GSList*) = _cons_show_themes;
 
-void
-cons_prefs(void)
+static void
+_cons_prefs(void)
 {
     cons_show("");
     cons_show_ui_prefs();
@@ -1270,9 +1326,10 @@ cons_prefs(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_prefs)(void) = _cons_prefs;
 
-void
-cons_help(void)
+static void
+_cons_help(void)
 {
     cons_show("");
     cons_show("Choose a help option:");
@@ -1293,9 +1350,10 @@ cons_help(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_help)(void) = _cons_help;
 
-void
-cons_navigation_help(void)
+static void
+_cons_navigation_help(void)
 {
     cons_show("");
     cons_show("Navigation:");
@@ -1317,9 +1375,10 @@ cons_navigation_help(void)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_navigation_help)(void) = _cons_navigation_help;
 
-void
-cons_show_roster_group(const char * const group, GSList *list)
+static void
+_cons_show_roster_group(const char * const group, GSList *list)
 {
     cons_show("");
 
@@ -1333,9 +1392,10 @@ cons_show_roster_group(const char * const group, GSList *list)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_roster_group)(const char * const, GSList*) = _cons_show_roster_group;
 
-void
-cons_show_roster(GSList *list)
+static void
+_cons_show_roster(GSList *list)
 {
     cons_show("");
     cons_show("Roster:");
@@ -1344,9 +1404,10 @@ cons_show_roster(GSList *list)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_roster)(GSList*) = _cons_show_roster;
 
-void
-cons_show_contacts(GSList *list)
+static void
+_cons_show_contacts(GSList *list)
 {
     ProfWin *console = wins_get_console();
     GSList *curr = list;
@@ -1363,14 +1424,16 @@ cons_show_contacts(GSList *list)
     wins_refresh_console();
     cons_alert();
 }
+void (*cons_show_contacts)(GSList*) = _cons_show_contacts;
 
-void
-cons_alert(void)
+static void
+_cons_alert(void)
 {
     if (ui_current_win_type() != WIN_CONSOLE) {
         status_bar_new(1);
     }
 }
+void (*cons_alert)(void) = _cons_alert;
 
 static void
 _cons_splash_logo(void)
diff --git a/src/ui/core.c b/src/ui/core.c
index 1ff41b7d..b68d2edc 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -69,8 +69,8 @@ static void _win_show_history(WINDOW *win, int win_index,
     const char * const contact);
 static void _ui_draw_win_title(void);
 
-void
-ui_init(void)
+static void
+_ui_init(void)
 {
     log_info("Initialising UI");
     initscr();
@@ -95,18 +95,20 @@ ui_init(void)
     ui_idle_time = g_timer_new();
     wins_refresh_current();
 }
+void (*ui_init)(void) = _ui_init;
 
-void
-ui_refresh(void)
+static void
+_ui_refresh(void)
 {
     _ui_draw_win_title();
     title_bar_refresh();
     status_bar_refresh();
     inp_put_back();
 }
+void (*ui_refresh)(void) = _ui_refresh;
 
-unsigned long
-ui_get_idle_time(void)
+static unsigned long
+_ui_get_idle_time(void)
 {
 // if compiled with libxss, get the x sessions idle time
 #ifdef HAVE_LIBXSS
@@ -123,23 +125,26 @@ ui_get_idle_time(void)
     unsigned long ms_elapsed = seconds_elapsed * 1000.0;
     return ms_elapsed;
 }
+unsigned long (*ui_get_idle_time)(void) = _ui_get_idle_time;
 
-void
-ui_reset_idle_time(void)
+static void
+_ui_reset_idle_time(void)
 {
     g_timer_start(ui_idle_time);
 }
+void (*ui_reset_idle_time)(void) = _ui_reset_idle_time;
 
-void
-ui_close(void)
+static void
+_ui_close(void)
 {
     notifier_uninit();
     wins_destroy();
     endwin();
 }
+void (*ui_close)(void) = _ui_close;
 
-void
-ui_resize(const int ch, const char * const input, const int size)
+static void
+_ui_resize(const int ch, const char * const input, const int size)
 {
     log_info("Resizing UI");
     title_bar_resize();
@@ -148,9 +153,10 @@ ui_resize(const int ch, const char * const input, const int size)
     inp_win_resize(input, size);
     wins_refresh_current();
 }
+void (*ui_resize)(const int, const char * const, const int) = _ui_resize;
 
-void
-ui_load_colours(void)
+static void
+_ui_load_colours(void)
 {
     if (has_colors()) {
         use_default_colors();
@@ -158,22 +164,25 @@ ui_load_colours(void)
         theme_init_colours();
     }
 }
+void (*ui_load_colours)(void) = _ui_load_colours;
 
-gboolean
-ui_win_exists(int index)
+static gboolean
+_ui_win_exists(int index)
 {
     ProfWin *window = wins_get_by_num(index);
     return (window != NULL);
 }
+gboolean (*ui_win_exists)(int) = _ui_win_exists;
 
-gboolean
-ui_duck_exists(void)
+static gboolean
+_ui_duck_exists(void)
 {
     return wins_duck_exists();
 }
+gboolean (*ui_duck_exists)(void) = _ui_duck_exists;
 
-void
-ui_contact_typing(const char * const barejid)
+static void
+_ui_contact_typing(const char * const barejid)
 {
     ProfWin *window = wins_get_by_recipient(barejid);
 
@@ -209,16 +218,18 @@ ui_contact_typing(const char * const barejid)
         notify_typing(display_usr);
     }
 }
+void (*ui_contact_typing)(const char * const) = _ui_contact_typing;
 
-GSList *
-ui_get_recipients(void)
+static GSList *
+_ui_get_recipients(void)
 {
     GSList *recipients = wins_get_chat_recipients();
     return recipients;
 }
+GSList * (*ui_get_recipients)(void) = _ui_get_recipients;
 
-void
-ui_incoming_msg(const char * const from, const char * const message,
+static void
+_ui_incoming_msg(const char * const from, const char * const message,
     GTimeVal *tv_stamp, gboolean priv)
 {
     gboolean win_created = FALSE;
@@ -293,9 +304,11 @@ ui_incoming_msg(const char * const from, const char * const message,
 
     free(display_from);
 }
+void (*ui_incoming_msg)(const char * const, const char * const,
+    GTimeVal*, gboolean) = _ui_incoming_msg;
 
-void
-ui_roster_add(const char * const barejid, const char * const name)
+static void
+_ui_roster_add(const char * const barejid, const char * const name)
 {
     if (name != NULL) {
         cons_show("Roster item added: %s (%s)", barejid, name);
@@ -303,39 +316,45 @@ ui_roster_add(const char * const barejid, const char * const name)
         cons_show("Roster item added: %s", barejid);
     }
 }
+void (*ui_roster_add)(const char * const, const char * const) = _ui_roster_add;
 
-void
-ui_roster_remove(const char * const barejid)
+static void
+_ui_roster_remove(const char * const barejid)
 {
     cons_show("Roster item removed: %s", barejid);
 }
+void (*ui_roster_remove)(const char * const) = _ui_roster_remove;
 
-void
-ui_contact_already_in_group(const char * const contact, const char * const group)
+static void
+_ui_contact_already_in_group(const char * const contact, const char * const group)
 {
     cons_show("%s already in group %s", contact, group);
 }
+void (*ui_contact_already_in_group)(const char * const, const char * const) = _ui_contact_already_in_group;
 
-void
-ui_contact_not_in_group(const char * const contact, const char * const group)
+static void
+_ui_contact_not_in_group(const char * const contact, const char * const group)
 {
     cons_show("%s is not currently in group %s", contact, group);
 }
+void (*ui_contact_not_in_group)(const char * const, const char * const) = _ui_contact_not_in_group;
 
-void
-ui_group_added(const char * const contact, const char * const group)
+static void
+_ui_group_added(const char * const contact, const char * const group)
 {
     cons_show("%s added to group %s", contact, group);
 }
+void (*ui_group_added)(const char * const, const char * const) = _ui_group_added;
 
-void
-ui_group_removed(const char * const contact, const char * const group)
+static void
+_ui_group_removed(const char * const contact, const char * const group)
 {
     cons_show("%s removed from group %s", contact, group);
 }
+void (*ui_group_removed)(const char * const, const char * const) = _ui_group_removed;
 
-void
-ui_handle_error_message(const char * const from, const char * const err_msg)
+static void
+_ui_handle_error_message(const char * const from, const char * const err_msg)
 {
     if (err_msg == NULL) {
         cons_show_error("Unknown error received from service.");
@@ -349,9 +368,11 @@ ui_handle_error_message(const char * const from, const char * const err_msg)
 
     ui_print_error_from_recipient(from, err_msg);
 }
+void (*ui_handle_error_message)(const char * const,
+    const char * const) = _ui_handle_error_message;
 
-void
-ui_contact_online(const char * const barejid, const char * const resource,
+static void
+_ui_contact_online(const char * const barejid, const char * const resource,
     const char * const show, const char * const status, GDateTime *last_activity)
 {
     PContact contact = roster_get_contact(barejid);
@@ -375,9 +396,11 @@ ui_contact_online(const char * const barejid, const char * const resource,
         wins_refresh_current();
     }
 }
+void (*ui_contact_online)(const char * const, const char * const,
+    const char * const, const char * const, GDateTime*) = _ui_contact_online;
 
-void
-ui_contact_offline(const char * const from, const char * const show,
+static void
+_ui_contact_offline(const char * const from, const char * const show,
     const char * const status)
 {
     Jid *jidp = jid_create(from);
@@ -403,18 +426,21 @@ ui_contact_offline(const char * const from, const char * const show,
         wins_refresh_current();
     }
 }
+void (*ui_contact_offline)(const char * const, const char * const,
+    const char * const) = _ui_contact_offline;
 
-void
-ui_disconnected(void)
+static void
+_ui_disconnected(void)
 {
     wins_lost_connection();
     title_bar_set_status(CONTACT_OFFLINE);
     status_bar_clear_message();
     status_bar_refresh();
 }
+void (*ui_disconnected)(void) = _ui_disconnected;
 
-void
-ui_handle_special_keys(const wint_t * const ch, const char * const inp,
+static void
+_ui_handle_special_keys(const wint_t * const ch, const char * const inp,
     const int size)
 {
     _win_handle_switch(ch);
@@ -424,9 +450,11 @@ ui_handle_special_keys(const wint_t * const ch, const char * const inp,
     }
 
 }
+void (*ui_handle_special_keys)(const wint_t * const, const char * const,
+    const int) = _ui_handle_special_keys;
 
-void
-ui_close_connected_win(int index)
+static void
+_ui_close_connected_win(int index)
 {
     win_type_t win_type = ui_win_type(index);
     if (win_type == WIN_MUC) {
@@ -446,9 +474,10 @@ ui_close_connected_win(int index)
         }
     }
 }
+void (*ui_close_connected_win)(int index) = _ui_close_connected_win;
 
-int
-ui_close_all_wins(void)
+static int
+_ui_close_all_wins(void)
 {
     int count = 0;
     jabber_conn_status_t conn_status = jabber_get_connection_status();
@@ -473,9 +502,10 @@ ui_close_all_wins(void)
 
     return count;
 }
+int (*ui_close_all_wins)(void) = _ui_close_all_wins;
 
-int
-ui_close_read_wins(void)
+static int
+_ui_close_read_wins(void)
 {
     int count = 0;
     jabber_conn_status_t conn_status = jabber_get_connection_status();
@@ -500,9 +530,10 @@ ui_close_read_wins(void)
 
     return count;
 }
+int (*ui_close_read_wins)(void) = _ui_close_read_wins;
 
-void
-ui_switch_win(const int i)
+static void
+_ui_switch_win(const int i)
 {
     ui_current_page_off();
     ProfWin *new_current = wins_get_by_num(i);
@@ -534,9 +565,10 @@ ui_switch_win(const int i)
         wins_refresh_current();
     }
 }
+void (*ui_switch_win)(const int) = _ui_switch_win;
 
-void
-ui_next_win(void)
+static void
+_ui_next_win(void)
 {
     ui_current_page_off();
     ProfWin *new_current = wins_get_next();
@@ -567,9 +599,10 @@ ui_next_win(void)
     }
     wins_refresh_current();
 }
+void (*ui_next_win)(void) = _ui_next_win;
 
-void
-ui_previous_win(void)
+static void
+_ui_previous_win(void)
 {
     ui_current_page_off();
     ProfWin *new_current = wins_get_previous();
@@ -600,15 +633,17 @@ ui_previous_win(void)
     }
     wins_refresh_current();
 }
+void (*ui_previous_win)(void) = _ui_previous_win;
 
-void
-ui_clear_current(void)
+static void
+_ui_clear_current(void)
 {
     wins_clear_current();
 }
+void (*ui_clear_current)(void) = _ui_clear_current;
 
-void
-ui_close_current(void)
+static void
+_ui_close_current(void)
 {
     int current_index = wins_get_current_num();
     status_bar_inactive(current_index);
@@ -617,9 +652,10 @@ ui_close_current(void)
     status_bar_active(1);
     title_bar_title();
 }
+void (*ui_close_current)(void) = _ui_close_current;
 
-void
-ui_close_win(int index)
+static void
+_ui_close_win(int index)
 {
     wins_close_by_num(index);
     status_bar_current(1);
@@ -628,9 +664,10 @@ ui_close_win(int index)
 
     wins_refresh_current();
 }
+void (*ui_close_win)(int) = _ui_close_win;
 
-void
-ui_tidy_wins(void)
+static void
+_ui_tidy_wins(void)
 {
     gboolean tidied = wins_tidy();
 
@@ -640,9 +677,10 @@ ui_tidy_wins(void)
         cons_show("No tidy needed.");
     }
 }
+void (*ui_tidy_wins)(void) = _ui_tidy_wins;
 
-void
-ui_prune_wins(void)
+static void
+_ui_prune_wins(void)
 {
     jabber_conn_status_t conn_status = jabber_get_connection_status();
     gboolean pruned = FALSE;
@@ -685,43 +723,49 @@ ui_prune_wins(void)
         cons_show("No prune needed.");
     }
 }
+void (*ui_prune_wins)(void) = _ui_prune_wins;
 
-win_type_t
-ui_current_win_type(void)
+static win_type_t
+_ui_current_win_type(void)
 {
     ProfWin *current = wins_get_current();
     return current->type;
 }
+win_type_t (*ui_current_win_type)(void) = _ui_current_win_type;
 
-int
-ui_current_win_index(void)
+static int
+_ui_current_win_index(void)
 {
     return wins_get_current_num();
 }
+int (*ui_current_win_index)(void) = _ui_current_win_index;
 
-win_type_t
-ui_win_type(int index)
+static win_type_t
+_ui_win_type(int index)
 {
     ProfWin *window = wins_get_by_num(index);
     return window->type;
 }
+win_type_t (*ui_win_type)(int index) = _ui_win_type;
 
-char *
-ui_recipient(int index)
+static char *
+_ui_recipient(int index)
 {
     ProfWin *window = wins_get_by_num(index);
     return window->from;
 }
+char * (*ui_recipient)(int) = _ui_recipient;
 
-char *
-ui_current_recipient(void)
+static char *
+_ui_current_recipient(void)
 {
     ProfWin *current = wins_get_current();
     return current->from;
 }
+char* (*ui_current_recipient)(void) = _ui_current_recipient;
 
-void
-ui_current_print_line(const char * const msg, ...)
+static void
+_ui_current_print_line(const char * const msg, ...)
 {
     ProfWin *current = wins_get_current();
     va_list arg;
@@ -730,25 +774,28 @@ ui_current_print_line(const char * const msg, ...)
     va_end(arg);
     win_refresh(current);
 }
+void (*ui_current_print_line)(const char * const, ...) = _ui_current_print_line;
 
-void
-ui_current_error_line(const char * const msg)
+static void
+_ui_current_error_line(const char * const msg)
 {
     ProfWin *current = wins_get_current();
     win_print_line(current, '-', COLOUR_ERROR, msg);
     win_refresh(current);
 }
+void (*ui_current_error_line)(const char * const) = _ui_current_error_line;
 
-void
-ui_current_page_off(void)
+static void
+_ui_current_page_off(void)
 {
     ProfWin *current = wins_get_current();
     win_page_off(current);
     win_refresh(current);
 }
+void (*ui_current_page_off)(void) = _ui_current_page_off;
 
-void
-ui_print_error_from_recipient(const char * const from, const char *err_msg)
+static void
+_ui_print_error_from_recipient(const char * const from, const char *err_msg)
 {
     if (from == NULL || err_msg == NULL)
         return;
@@ -761,9 +808,10 @@ ui_print_error_from_recipient(const char * const from, const char *err_msg)
         }
     }
 }
+void (*ui_print_error_from_recipient)(const char * const, const char *) = _ui_print_error_from_recipient;
 
-void
-ui_print_system_msg_from_recipient(const char * const from, const char *message)
+static void
+_ui_print_system_msg_from_recipient(const char * const from, const char *message)
 {
     int num = 0;
     char from_cpy[strlen(from) + 1];
@@ -796,9 +844,11 @@ ui_print_system_msg_from_recipient(const char * const from, const char *message)
         wins_refresh_current();
     }
 }
+void (*ui_print_system_msg_from_recipient)(const char * const,
+    const char *) = _ui_print_system_msg_from_recipient;
 
-void
-ui_recipient_gone(const char * const barejid)
+static void
+_ui_recipient_gone(const char * const barejid)
 {
     if (barejid == NULL)
         return;
@@ -819,9 +869,10 @@ ui_recipient_gone(const char * const barejid)
         }
     }
 }
+void (*ui_recipient_gone)(const char * const) = _ui_recipient_gone;
 
-void
-ui_new_chat_win(const char * const to)
+static void
+_ui_new_chat_win(const char * const to)
 {
     // if the contact is offline, show a message
     PContact contact = roster_get_contact(to);
@@ -858,18 +909,20 @@ ui_new_chat_win(const char * const to)
 
     ui_switch_win(num);
 }
+void (*ui_new_chat_win)(const char * const) = _ui_new_chat_win;
 
-void
-ui_create_duck_win(void)
+static void
+_ui_create_duck_win(void)
 {
     ProfWin *window = wins_new("DuckDuckGo search", WIN_DUCK);
     int num = wins_get_num(window);
     ui_switch_win(num);
     win_print_line(window, '-', 0, "Type ':help' to find out more.");
 }
+void (*ui_create_duck_win)(void) = _ui_create_duck_win;
 
-void
-ui_open_duck_win(void)
+static void
+_ui_open_duck_win(void)
 {
     ProfWin *window = wins_get_by_recipient("DuckDuckGo search");
     if (window != NULL) {
@@ -877,9 +930,10 @@ ui_open_duck_win(void)
         ui_switch_win(num);
     }
 }
+void (*ui_open_duck_win)(void) = _ui_open_duck_win;
 
-void
-ui_duck(const char * const query)
+static void
+_ui_duck(const char * const query)
 {
     ProfWin *window = wins_get_by_recipient("DuckDuckGo search");
     if (window != NULL) {
@@ -893,9 +947,10 @@ ui_duck(const char * const query)
         wprintw(window->win, "\n");
     }
 }
+void (*ui_duck)(const char * const) = _ui_duck;
 
-void
-ui_duck_result(const char * const result)
+static void
+_ui_duck_result(const char * const result)
 {
     ProfWin *window = wins_get_by_recipient("DuckDuckGo search");
 
@@ -926,9 +981,10 @@ ui_duck_result(const char * const result)
         wprintw(window->win, "\n");
     }
 }
+void (*ui_duck_result)(const char * const) = _ui_duck_result;
 
-void
-ui_outgoing_msg(const char * const from, const char * const to,
+static void
+_ui_outgoing_msg(const char * const from, const char * const to,
     const char * const message)
 {
     PContact contact = roster_get_contact(to);
@@ -978,9 +1034,11 @@ ui_outgoing_msg(const char * const from, const char * const to,
     }
     ui_switch_win(num);
 }
+void (*ui_outgoing_msg)(const char * const, const char * const,
+    const char * const) = _ui_outgoing_msg;
 
-void
-ui_room_join(Jid *jid)
+static void
+_ui_room_join(Jid *jid)
 {
     ProfWin *window = wins_get_by_recipient(jid->barejid);
     int num = 0;
@@ -993,9 +1051,10 @@ ui_room_join(Jid *jid)
     num = wins_get_num(window);
     ui_switch_win(num);
 }
+void (*ui_room_join)(Jid *) = _ui_room_join;
 
-void
-ui_room_roster(const char * const room, GList *roster, const char * const presence)
+static void
+_ui_room_roster(const char * const room, GList *roster, const char * const presence)
 {
     ProfWin *window = wins_get_by_recipient(room);
 
@@ -1048,9 +1107,10 @@ ui_room_roster(const char * const room, GList *roster, const char * const presen
         wins_refresh_current();
     }
 }
+void (*ui_room_roster)(const char * const, GList*, const char * const) = _ui_room_roster;
 
-void
-ui_room_member_offline(const char * const room, const char * const nick)
+static void
+_ui_room_member_offline(const char * const room, const char * const nick)
 {
     ProfWin *window = wins_get_by_recipient(room);
 
@@ -1063,9 +1123,10 @@ ui_room_member_offline(const char * const room, const char * const nick)
         wins_refresh_current();
     }
 }
+void (*ui_room_member_offline)(const char * const, const char * const) = _ui_room_member_offline;
 
-void
-ui_room_member_online(const char * const room, const char * const nick,
+static void
+_ui_room_member_online(const char * const room, const char * const nick,
     const char * const show, const char * const status)
 {
     ProfWin *window = wins_get_by_recipient(room);
@@ -1079,9 +1140,11 @@ ui_room_member_online(const char * const room, const char * const nick,
         wins_refresh_current();
     }
 }
+void (*ui_room_member_online)(const char * const, const char * const,
+    const char * const, const char * const) = _ui_room_member_online;
 
-void
-ui_room_member_presence(const char * const room, const char * const nick,
+static void
+_ui_room_member_presence(const char * const room, const char * const nick,
     const char * const show, const char * const status)
 {
     ProfWin *window = wins_get_by_recipient(room);
@@ -1094,9 +1157,11 @@ ui_room_member_presence(const char * const room, const char * const nick,
         wins_refresh_current();
     }
 }
+void (*ui_room_member_presence)(const char * const, const char * const,
+    const char * const, const char * const) = _ui_room_member_presence;
 
-void
-ui_room_member_nick_change(const char * const room,
+static void
+_ui_room_member_nick_change(const char * const room,
     const char * const old_nick, const char * const nick)
 {
     ProfWin *window = wins_get_by_recipient(room);
@@ -1110,9 +1175,11 @@ ui_room_member_nick_change(const char * const room,
         wins_refresh_current();
     }
 }
+void (*ui_room_member_nick_change)(const char * const,
+    const char * const, const char * const) = _ui_room_member_nick_change;
 
-void
-ui_room_nick_change(const char * const room, const char * const nick)
+static void
+_ui_room_nick_change(const char * const room, const char * const nick)
 {
     ProfWin *window = wins_get_by_recipient(room);
 
@@ -1125,9 +1192,10 @@ ui_room_nick_change(const char * const room, const char * const nick)
         wins_refresh_current();
     }
 }
+void (*ui_room_nick_change)(const char * const, const char * const) = _ui_room_nick_change;
 
-void
-ui_room_history(const char * const room_jid, const char * const nick,
+static void
+_ui_room_history(const char * const room_jid, const char * const nick,
     GTimeVal tv_stamp, const char * const message)
 {
     ProfWin *window = wins_get_by_recipient(room_jid);
@@ -1151,9 +1219,11 @@ ui_room_history(const char * const room_jid, const char * const nick,
         wins_refresh_current();
     }
 }
+void (*ui_room_history)(const char * const, const char * const,
+    GTimeVal, const char * const) = _ui_room_history;
 
-void
-ui_room_message(const char * const room_jid, const char * const nick,
+static void
+_ui_room_message(const char * const room_jid, const char * const nick,
     const char * const message)
 {
     ProfWin *window = wins_get_by_recipient(room_jid);
@@ -1223,9 +1293,11 @@ ui_room_message(const char * const room_jid, const char * const nick,
         }
     }
 }
+void (*ui_room_message)(const char * const, const char * const,
+    const char * const) = _ui_room_message;
 
-void
-ui_room_subject(const char * const room_jid, const char * const subject)
+static void
+_ui_room_subject(const char * const room_jid, const char * const subject)
 {
     ProfWin *window = wins_get_by_recipient(room_jid);
     int num = wins_get_num(window);
@@ -1246,9 +1318,10 @@ ui_room_subject(const char * const room_jid, const char * const subject)
         status_bar_new(num);
     }
 }
+void (*ui_room_subject)(const char * const, const char * const) = _ui_room_subject;
 
-void
-ui_room_broadcast(const char * const room_jid, const char * const message)
+static void
+_ui_room_broadcast(const char * const room_jid, const char * const message)
 {
     ProfWin *window = wins_get_by_recipient(room_jid);
     int num = wins_get_num(window);
@@ -1269,9 +1342,10 @@ ui_room_broadcast(const char * const room_jid, const char * const message)
         status_bar_new(num);
     }
 }
+void (*ui_room_broadcast)(const char * const, const char * const) = _ui_room_broadcast;
 
-void
-ui_status(void)
+static void
+_ui_status(void)
 {
     char *recipient = ui_current_recipient();
     PContact pcontact = roster_get_contact(recipient);
@@ -1283,9 +1357,10 @@ ui_status(void)
         win_print_line(current, '-', 0, "Error getting contact info.");
     }
 }
+void (*ui_status)(void) = _ui_status;
 
-void
-ui_status_private(void)
+static void
+_ui_status_private(void)
 {
     Jid *jid = jid_create(ui_current_recipient());
     PContact pcontact = muc_get_participant(jid->barejid, jid->resourcepart);
@@ -1299,9 +1374,10 @@ ui_status_private(void)
 
     jid_destroy(jid);
 }
+void (*ui_status_private)(void) = _ui_status_private;
 
-void
-ui_status_room(const char * const contact)
+static void
+_ui_status_room(const char * const contact)
 {
     PContact pcontact = muc_get_participant(ui_current_recipient(), contact);
     ProfWin *current = wins_get_current();
@@ -1312,15 +1388,17 @@ ui_status_room(const char * const contact)
         win_print_line(current, '-', 0, "No such participant \"%s\" in room.", contact);
     }
 }
+void (*ui_status_room)(const char * const) = _ui_status_room;
 
-gint
-ui_unread(void)
+static gint
+_ui_unread(void)
 {
     return wins_get_total_unread();
 }
+gint (*ui_unread)(void) = _ui_unread;
 
-int
-ui_win_unread(int index)
+static int
+_ui_win_unread(int index)
 {
     ProfWin *window = wins_get_by_num(index);
     if (window != NULL) {
@@ -1329,9 +1407,10 @@ ui_win_unread(int index)
         return 0;
     }
 }
+int (*ui_win_unread)(int) = _ui_win_unread;
 
-char *
-ui_ask_password(void)
+static char *
+_ui_ask_password(void)
 {
   char *passwd = malloc(sizeof(char) * (MAX_PASSWORD_SIZE + 1));
   status_bar_get_password();
@@ -1342,6 +1421,7 @@ ui_ask_password(void)
 
   return passwd;
 }
+char * (*ui_ask_password)(void) = _ui_ask_password;
 
 static void
 _ui_draw_win_title(void)
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c
index 3306a246..040e87b2 100644
--- a/src/ui/inputwin.c
+++ b/src/ui/inputwin.c
@@ -58,8 +58,8 @@ static int _printable(const wint_t ch);
 static void _clear_input(void);
 static void _go_to_end(int display_size);
 
-void
-create_input_window(void)
+static void
+_create_input_window(void)
 {
 #ifdef NCURSES_REENTRANT
     set_escdelay(25);
@@ -73,9 +73,10 @@ create_input_window(void)
     wmove(inp_win, 0, 0);
     _inp_win_refresh();
 }
+void (*create_input_window)(void) = _create_input_window;
 
-void
-inp_win_resize(const char * const input, const int size)
+static void
+_inp_win_resize(const char * const input, const int size)
 {
     int inp_x;
     getmaxyx(stdscr, rows, cols);
@@ -91,21 +92,24 @@ inp_win_resize(const char * const input, const int size)
 
     _inp_win_refresh();
 }
+void (*inp_win_resize)(const char * const, const int) = _inp_win_resize;
 
-void
-inp_non_block(void)
+static void
+_inp_non_block(void)
 {
     wtimeout(inp_win, 20);
 }
+void (*inp_non_block)(void) = _inp_non_block;
 
-void
-inp_block(void)
+static void
+_inp_block(void)
 {
     wtimeout(inp_win, -1);
 }
+void (*inp_block)(void) = _inp_block;
 
-wint_t
-inp_get_char(char *input, int *size)
+static wint_t
+_inp_get_char(char *input, int *size)
 {
     int inp_x = 0;
     int i;
@@ -202,9 +206,10 @@ inp_get_char(char *input, int *size)
 
     return ch;
 }
+wint_t (*inp_get_char)(char*, int*) = _inp_get_char;
 
-void
-inp_get_password(char *passwd)
+static void
+_inp_get_password(char *passwd)
 {
     _clear_input();
     _inp_win_refresh();
@@ -214,15 +219,17 @@ inp_get_password(char *passwd)
     echo();
     status_bar_clear();
 }
+void (*inp_get_password)(char*) = _inp_get_password;
 
-void
-inp_put_back(void)
+static void
+_inp_put_back(void)
 {
     _inp_win_refresh();
 }
+void (*inp_put_back)(void) = _inp_put_back;
 
-void
-inp_replace_input(char *input, const char * const new_input, int *size)
+static void
+_inp_replace_input(char *input, const char * const new_input, int *size)
 {
     int display_size;
     strcpy(input, new_input);
@@ -233,14 +240,16 @@ inp_replace_input(char *input, const char * const new_input, int *size)
     waddstr(inp_win, input);
     _go_to_end(display_size);
 }
+void (*inp_replace_input)(char*, const char * const, int*) = _inp_replace_input;
 
-void
-inp_win_reset(void)
+static void
+_inp_win_reset(void)
 {
     _clear_input();
     pad_start = 0;
     _inp_win_refresh();
 }
+void (*inp_win_reset)(void) = _inp_win_reset;
 
 static void
 _clear_input(void)
diff --git a/src/ui/notifier.c b/src/ui/notifier.c
index 403c215e..d0319cb9 100644
--- a/src/ui/notifier.c
+++ b/src/ui/notifier.c
@@ -39,16 +39,17 @@
 static void _notify(const char * const message, int timeout,
     const char * const category);
 
-void
-notifier_init(void)
+static void
+_notifier_init(void)
 {
 #ifdef HAVE_LIBNOTIFY
     notify_init("Profanity");
 #endif
 }
+void (*notifier_init)(void) = _notifier_init;
 
-void
-notifier_uninit(void)
+static void
+_notifier_uninit(void)
 {
 #ifdef HAVE_LIBNOTIFY
     if (notify_is_initted()) {
@@ -56,18 +57,20 @@ notifier_uninit(void)
     }
 #endif
 }
+void (*notifier_uninit)(void) = _notifier_uninit;
 
-void
-notify_typing(const char * const handle)
+static void
+_notify_typing(const char * const handle)
 {
     char message[strlen(handle) + 1 + 11];
     sprintf(message, "%s: typing...", handle);
 
     _notify(message, 10000, "Incoming message");
 }
+void (*notify_typing)(const char * const) = _notify_typing;
 
-void
-notify_invite(const char * const from, const char * const room,
+static void
+_notify_invite(const char * const from, const char * const room,
     const char * const reason)
 {
     GString *message = g_string_new("Room invite\nfrom: ");
@@ -82,18 +85,21 @@ notify_invite(const char * const from, const char * const room,
 
     g_string_free(message, TRUE);
 }
+void (*notify_invite)(const char * const, const char * const,
+    const char * const) = _notify_invite;
 
-void
-notify_message(const char * const handle, int win)
+static void
+_notify_message(const char * const handle, int win)
 {
     char message[strlen(handle) + 1 + 14];
     sprintf(message, "%s: message (%d).", handle, win);
 
     _notify(message, 10000, "incoming message");
 }
+void (*notify_message)(const char * const, int) = _notify_message;
 
-void
-notify_room_message(const char * const handle, const char * const room, int win)
+static void
+_notify_room_message(const char * const handle, const char * const room, int win)
 {
     GString *text = g_string_new("");
 
@@ -104,18 +110,21 @@ notify_room_message(const char * const handle, const char * const room, int win)
 
     g_string_free(text, TRUE);
 }
+void (*notify_room_message)(const char * const, const char * const,
+    int) = _notify_room_message;
 
-void
-notify_subscription(const char * const from)
+static void
+_notify_subscription(const char * const from)
 {
     GString *message = g_string_new("Subscription request: \n");
     g_string_append(message, from);
     _notify(message->str, 10000, "Incomming message");
     g_string_free(message, TRUE);
 }
+void (*notify_subscription)(const char * const) = _notify_subscription;
 
-void
-notify_remind(void)
+static void
+_notify_remind(void)
 {
     gint unread = ui_unread();
     gint open = muc_invite_count();
@@ -158,6 +167,7 @@ notify_remind(void)
 
     g_string_free(text, TRUE);
 }
+void (*notify_remind)(void) = _notify_remind;
 
 static void
 _notify(const char * const message, int timeout,
diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c
index 16bd31c9..8a578a56 100644
--- a/src/ui/statusbar.c
+++ b/src/ui/statusbar.c
@@ -54,8 +54,8 @@ static void _mark_new(int num);
 static void _mark_active(int num);
 static void _mark_inactive(int num);
 
-void
-create_status_bar(void)
+static void
+_create_status_bar(void)
 {
     int rows, cols, i;
     getmaxyx(stdscr, rows, cols);
@@ -83,9 +83,10 @@ create_status_bar(void)
 
     dirty = TRUE;
 }
+void (*create_status_bar)(void) = _create_status_bar;
 
-void
-status_bar_refresh(void)
+static void
+_status_bar_refresh(void)
 {
     GDateTime *now_time = g_date_time_new_now_local();
     GTimeSpan elapsed = g_date_time_difference(now_time, last_time);
@@ -107,9 +108,10 @@ status_bar_refresh(void)
 
     g_date_time_unref(now_time);
 }
+void (*status_bar_refresh)(void) = _status_bar_refresh;
 
-void
-status_bar_resize(void)
+static void
+_status_bar_resize(void)
 {
     int rows, cols;
     getmaxyx(stdscr, rows, cols);
@@ -133,9 +135,10 @@ status_bar_resize(void)
     last_time = g_date_time_new_now_local();
     dirty = TRUE;
 }
+void (*status_bar_resize)(void) = _status_bar_resize;
 
-void
-status_bar_set_all_inactive(void)
+static void
+_status_bar_set_all_inactive(void)
 {
     int i = 0;
     for (i = 0; i < 12; i++) {
@@ -147,9 +150,10 @@ status_bar_set_all_inactive(void)
     g_hash_table_remove_all(remaining_active);
     g_hash_table_remove_all(remaining_new);
 }
+void (*status_bar_set_all_inactive)(void) = _status_bar_set_all_inactive;
 
-void
-status_bar_current(int i)
+static void
+_status_bar_current(int i)
 {
     if (i == 0) {
         current = 10;
@@ -164,9 +168,10 @@ status_bar_current(int i)
     mvwprintw(status_bar, 0, cols - 34 + ((current - 1) * 3), bracket);
     wattroff(status_bar, COLOUR_STATUS_BRACKET);
 }
+void (*status_bar_current)(int) = _status_bar_current;
 
-void
-status_bar_inactive(const int win)
+static void
+_status_bar_inactive(const int win)
 {
     int true_win = win;
     if (true_win == 0) {
@@ -204,9 +209,10 @@ status_bar_inactive(const int win)
         _mark_inactive(true_win);
     }
 }
+void (*status_bar_inactive)(const int) = _status_bar_inactive;
 
-void
-status_bar_active(const int win)
+static void
+_status_bar_active(const int win)
 {
     int true_win = win;
     if (true_win == 0) {
@@ -238,9 +244,10 @@ status_bar_active(const int win)
         _mark_active(true_win);
     }
 }
+void (*status_bar_active)(const int) = _status_bar_active;
 
-void
-status_bar_new(const int win)
+static void
+_status_bar_new(const int win)
 {
     int true_win = win;
     if (true_win == 0) {
@@ -261,16 +268,18 @@ status_bar_new(const int win)
         _mark_new(true_win);
     }
 }
+void (*status_bar_new)(const int) = _status_bar_new;
 
-void
-status_bar_get_password(void)
+static void
+_status_bar_get_password(void)
 {
     status_bar_print_message("Enter password:");
     dirty = TRUE;
 }
+void (*status_bar_get_password)(void) = _status_bar_get_password;
 
-void
-status_bar_print_message(const char * const msg)
+static void
+_status_bar_print_message(const char * const msg)
 {
     werase(status_bar);
 
@@ -291,9 +300,10 @@ status_bar_print_message(const char * const msg)
     _update_win_statuses();
     dirty = TRUE;
 }
+void (*status_bar_print_message)(const char * const) = _status_bar_print_message;
 
-void
-status_bar_clear(void)
+static void
+_status_bar_clear(void)
 {
     if (message != NULL) {
         free(message);
@@ -319,9 +329,10 @@ status_bar_clear(void)
 
     dirty = TRUE;
 }
+void (*status_bar_clear)(void) = _status_bar_clear;
 
-void
-status_bar_clear_message(void)
+static void
+_status_bar_clear_message(void)
 {
     if (message != NULL) {
         free(message);
@@ -340,6 +351,7 @@ status_bar_clear_message(void)
     _update_win_statuses();
     dirty = TRUE;
 }
+void (*status_bar_clear_message)(void) = _status_bar_clear_message;
 
 static void
 _status_bar_update_time(void)
diff --git a/src/ui/titlebar.c b/src/ui/titlebar.c
index 791a5fbe..79baae1d 100644
--- a/src/ui/titlebar.c
+++ b/src/ui/titlebar.c
@@ -37,8 +37,8 @@ static contact_presence_t current_status;
 static void _title_bar_draw_title(void);
 static void _title_bar_draw_status(void);
 
-void
-create_title_bar(void)
+static void
+_create_title_bar(void)
 {
     int cols = getmaxx(stdscr);
 
@@ -48,9 +48,10 @@ create_title_bar(void)
     title_bar_set_status(CONTACT_OFFLINE);
     dirty = TRUE;
 }
+void (*create_title_bar)(void) = _create_title_bar;
 
-void
-title_bar_title(void)
+static void
+_title_bar_title(void)
 {
     werase(title_bar);
     recipient = NULL;
@@ -59,9 +60,10 @@ title_bar_title(void)
     _title_bar_draw_status();
     dirty = TRUE;
 }
+void (*title_bar_title)(void) = _title_bar_title;
 
-void
-title_bar_resize(void)
+static void
+_title_bar_resize(void)
 {
     int cols = getmaxx(stdscr);
 
@@ -72,9 +74,10 @@ title_bar_resize(void)
     _title_bar_draw_status();
     dirty = TRUE;
 }
+void (*title_bar_resize)(void) = _title_bar_resize;
 
-void
-title_bar_refresh(void)
+static void
+_title_bar_refresh(void)
 {
     if (recipient != NULL) {
 
@@ -106,9 +109,10 @@ title_bar_refresh(void)
         dirty = FALSE;
     }
 }
+void (*title_bar_refresh)(void) = _title_bar_refresh;
 
-void
-title_bar_show(const char * const title)
+static void
+_title_bar_show(const char * const title)
 {
     if (current_title != NULL)
         free(current_title);
@@ -117,16 +121,18 @@ title_bar_show(const char * const title)
     strcpy(current_title, title);
     _title_bar_draw_title();
 }
+void (*title_bar_show)(const char * const) = _title_bar_show;
 
-void
-title_bar_set_status(contact_presence_t status)
+static void
+_title_bar_set_status(contact_presence_t status)
 {
     current_status = status;
     _title_bar_draw_status();
 }
+void (*title_bar_set_status)(contact_presence_t) = _title_bar_set_status;
 
-void
-title_bar_set_recipient(const char * const from)
+static void
+_title_bar_set_recipient(const char * const from)
 {
     if (typing_elapsed != NULL) {
         g_timer_destroy(typing_elapsed);
@@ -143,9 +149,10 @@ title_bar_set_recipient(const char * const from)
 
     dirty = TRUE;
 }
+void (*title_bar_set_recipient)(const char * const) = _title_bar_set_recipient;
 
-void
-title_bar_set_typing(gboolean is_typing)
+static void
+_title_bar_set_typing(gboolean is_typing)
 {
     if (is_typing) {
         if (typing_elapsed != NULL) {
@@ -169,14 +176,16 @@ title_bar_set_typing(gboolean is_typing)
 
     dirty = TRUE;
 }
+void (*title_bar_set_typing)(gboolean) = _title_bar_set_typing;
 
-void
-title_bar_draw(void)
+static void
+_title_bar_draw(void)
 {
     werase(title_bar);
     _title_bar_draw_status();
     _title_bar_draw_title();
 }
+void (*title_bar_draw)(void) = _title_bar_draw;
 
 static void
 _title_bar_draw_status(void)
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 539146b7..482d8735 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -42,218 +42,213 @@
 #define INP_WIN_MAX 1000
 
 // ui startup and control
-void ui_init(void);
-void ui_load_colours(void);
-void ui_refresh(void);
-void ui_close(void);
-void ui_resize(const int ch, const char * const input,
+void (*ui_init)(void);
+void (*ui_load_colours)(void);
+void (*ui_refresh)(void);
+void (*ui_close)(void);
+void (*ui_resize)(const int ch, const char * const input,
     const int size);
-GSList* ui_get_recipients(void);
-void ui_handle_special_keys(const wint_t * const ch, const char * const inp,
+GSList* (*ui_get_recipients)(void);
+void (*ui_handle_special_keys)(const wint_t * const ch, const char * const inp,
     const int size);
-void ui_switch_win(const int i);
-void ui_next_win(void);
-void ui_previous_win(void);
-unsigned long ui_get_idle_time(void);
-void ui_reset_idle_time(void);
-void ui_new_chat_win(const char * const to);
-void ui_print_error_from_recipient(const char * const from, const char *err_msg);
-void ui_print_system_msg_from_recipient(const char * const from, const char *message);
-void ui_handle_error_message(const char * const from, const char * const err_msg);
-gint ui_unread(void);
-void ui_close_connected_win(int index);
-int ui_close_all_wins(void);
-int ui_close_read_wins(void);
+void (*ui_switch_win)(const int i);
+void (*ui_next_win)(void);
+void (*ui_previous_win)(void);
+unsigned long (*ui_get_idle_time)(void);
+void (*ui_reset_idle_time)(void);
+void (*ui_new_chat_win)(const char * const to);
+void (*ui_print_error_from_recipient)(const char * const from, const char *err_msg);
+void (*ui_print_system_msg_from_recipient)(const char * const from, const char *message);
+void (*ui_handle_error_message)(const char * const from, const char * const err_msg);
+gint (*ui_unread)(void);
+void (*ui_close_connected_win)(int index);
+int (*ui_close_all_wins)(void);
+int (*ui_close_read_wins)(void);
 
 // current window actions
-void ui_close_current(void);
-void ui_clear_current(void);
-win_type_t ui_current_win_type(void);
-int ui_current_win_index(void);
-char* ui_current_recipient(void);
-void ui_current_print_line(const char * const msg, ...);
-void ui_current_error_line(const char * const msg);
-void ui_current_page_off(void);
-
-win_type_t ui_win_type(int index);
-char * ui_recipient(int index);
-void ui_close_win(int index);
-gboolean ui_win_exists(int index);
-int ui_win_unread(int index);
-char * ui_ask_password(void);
+void (*ui_close_current)(void);
+void (*ui_clear_current)(void);
+win_type_t (*ui_current_win_type)(void);
+int (*ui_current_win_index)(void);
+char* (*ui_current_recipient)(void);
+void (*ui_current_print_line)(const char * const msg, ...);
+void (*ui_current_error_line)(const char * const msg);
+void (*ui_current_page_off)(void);
+
+win_type_t (*ui_win_type)(int index);
+char * (*ui_recipient)(int index);
+void (*ui_close_win)(int index);
+gboolean (*ui_win_exists)(int index);
+int (*ui_win_unread)(int index);
+char * (*ui_ask_password)(void);
 
 // ui events
-void ui_contact_typing(const char * const from);
-void ui_incoming_msg(const char * const from, const char * const message,
+void (*ui_contact_typing)(const char * const from);
+void (*ui_incoming_msg)(const char * const from, const char * const message,
     GTimeVal *tv_stamp, gboolean priv);
-void ui_contact_online(const char * const barejid, const char * const resource,
+void (*ui_contact_online)(const char * const barejid, const char * const resource,
     const char * const show, const char * const status, GDateTime *last_activity);
-void ui_contact_offline(const char * const from, const char * const show,
+void (*ui_contact_offline)(const char * const from, const char * const show,
     const char * const status);
-void ui_disconnected(void);
-void ui_recipient_gone(const char * const barejid);
-void ui_outgoing_msg(const char * const from, const char * const to,
+void (*ui_disconnected)(void);
+void (*ui_recipient_gone)(const char * const barejid);
+void (*ui_outgoing_msg)(const char * const from, const char * const to,
     const char * const message);
-void ui_room_join(Jid *jid);
-void ui_room_roster(const char * const room, GList *roster, const char * const presence);
-void ui_room_history(const char * const room_jid, const char * const nick,
+void (*ui_room_join)(Jid *jid);
+void (*ui_room_roster)(const char * const room, GList *roster, const char * const presence);
+void (*ui_room_history)(const char * const room_jid, const char * const nick,
     GTimeVal tv_stamp, const char * const message);
-void ui_room_message(const char * const room_jid, const char * const nick,
+void (*ui_room_message)(const char * const room_jid, const char * const nick,
     const char * const message);
-void ui_room_subject(const char * const room_jid,
+void (*ui_room_subject)(const char * const room_jid,
     const char * const subject);
-void ui_room_broadcast(const char * const room_jid,
+void (*ui_room_broadcast)(const char * const room_jid,
     const char * const message);
-void ui_room_member_offline(const char * const room, const char * const nick);
-void ui_room_member_online(const char * const room,
+void (*ui_room_member_offline)(const char * const room, const char * const nick);
+void (*ui_room_member_online)(const char * const room,
     const char * const nick, const char * const show, const char * const status);
-void ui_room_member_nick_change(const char * const room,
+void (*ui_room_member_nick_change)(const char * const room,
     const char * const old_nick, const char * const nick);
-void ui_room_nick_change(const char * const room, const char * const nick);
-void ui_room_member_presence(const char * const room,
+void (*ui_room_nick_change)(const char * const room, const char * const nick);
+void (*ui_room_member_presence)(const char * const room,
     const char * const nick, const char * const show, const char * const status);
-void ui_roster_add(const char * const barejid, const char * const name);
-void ui_roster_remove(const char * const barejid);
-void ui_contact_already_in_group(const char * const contact, const char * const group);
-void ui_contact_not_in_group(const char * const contact, const char * const group);
-void ui_group_added(const char * const contact, const char * const group);
-void ui_group_removed(const char * const contact, const char * const group);
+void (*ui_roster_add)(const char * const barejid, const char * const name);
+void (*ui_roster_remove)(const char * const barejid);
+void (*ui_contact_already_in_group)(const char * const contact, const char * const group);
+void (*ui_contact_not_in_group)(const char * const contact, const char * const group);
+void (*ui_group_added)(const char * const contact, const char * const group);
+void (*ui_group_removed)(const char * const contact, const char * const group);
 
 // contact status functions
-void ui_status_room(const char * const contact);
-void ui_status(void);
-void ui_status_private(void);
+void (*ui_status_room)(const char * const contact);
+void (*ui_status)(void);
+void (*ui_status_private)(void);
 
-void ui_create_duck_win(void);
-void ui_open_duck_win(void);
-void ui_duck(const char * const query);
-void ui_duck_result(const char * const result);
-gboolean ui_duck_exists(void);
+void (*ui_create_duck_win)(void);
+void (*ui_open_duck_win)(void);
+void (*ui_duck)(const char * const query);
+void (*ui_duck_result)(const char * const result);
+gboolean (*ui_duck_exists)(void);
 
-void ui_tidy_wins(void);
-void ui_prune_wins(void);
+void (*ui_tidy_wins)(void);
+void (*ui_prune_wins)(void);
 
 // create windows
-void create_title_bar(void);
-void create_status_bar(void);
-void create_input_window(void);
+void (*create_title_bar)(void);
+void (*create_status_bar)(void);
+void (*create_input_window)(void);
 
 // title bar actions
-void title_bar_refresh(void);
-void title_bar_resize(void);
-void title_bar_show(const char * const title);
-void title_bar_title(void);
-void title_bar_set_status(contact_presence_t status);
-void title_bar_set_recipient(const char * const from);
-void title_bar_set_typing(gboolean is_typing);
-void title_bar_draw(void);
+void (*title_bar_refresh)(void);
+void (*title_bar_resize)(void);
+void (*title_bar_show)(const char * const title);
+void (*title_bar_title)(void);
+void (*title_bar_set_status)(contact_presence_t status);
+void (*title_bar_set_recipient)(const char * const from);
+void (*title_bar_set_typing)(gboolean is_typing);
+void (*title_bar_draw)(void);
 
 // console window actions
 void (*cons_show)(const char * const msg, ...);
-void cons_about(void);
-void cons_help(void);
-void cons_basic_help(void);
-void cons_settings_help(void);
-void cons_presence_help(void);
-void cons_navigation_help(void);
-void cons_prefs(void);
-void cons_show_ui_prefs(void);
-void cons_show_desktop_prefs(void);
-void cons_show_chat_prefs(void);
-void cons_show_log_prefs(void);
-void cons_show_presence_prefs(void);
-void cons_show_connection_prefs(void);
-void cons_show_account(ProfAccount *account);
-void cons_debug(const char * const msg, ...);
-void cons_show_time(void);
-void cons_show_word(const char * const word);
-void cons_show_error(const char * const cmd, ...);
-void cons_highlight_show(const char * const cmd);
-void cons_show_contacts(GSList * list);
-void cons_show_roster(GSList * list);
-void cons_show_roster_group(const char * const group, GSList * list);
-void cons_show_wins(void);
-void cons_show_status(const char * const barejid);
-void cons_show_info(PContact pcontact);
-void cons_show_caps(const char * const contact, Resource *resource);
-void cons_show_themes(GSList *themes);
-void cons_show_login_success(ProfAccount *account);
-void cons_show_software_version(const char * const jid,
+void (*cons_about)(void);
+void (*cons_help)(void);
+void (*cons_navigation_help)(void);
+void (*cons_prefs)(void);
+void (*cons_show_ui_prefs)(void);
+void (*cons_show_desktop_prefs)(void);
+void (*cons_show_chat_prefs)(void);
+void (*cons_show_log_prefs)(void);
+void (*cons_show_presence_prefs)(void);
+void (*cons_show_connection_prefs)(void);
+void (*cons_show_account)(ProfAccount *account);
+void (*cons_debug)(const char * const msg, ...);
+void (*cons_show_time)(void);
+void (*cons_show_word)(const char * const word);
+void (*cons_show_error)(const char * const cmd, ...);
+void (*cons_show_contacts)(GSList * list);
+void (*cons_show_roster)(GSList * list);
+void (*cons_show_roster_group)(const char * const group, GSList * list);
+void (*cons_show_wins)(void);
+void (*cons_show_status)(const char * const barejid);
+void (*cons_show_info)(PContact pcontact);
+void (*cons_show_caps)(const char * const contact, Resource *resource);
+void (*cons_show_themes)(GSList *themes);
+void (*cons_show_login_success)(ProfAccount *account);
+void (*cons_show_software_version)(const char * const jid,
     const char * const presence, const char * const name,
     const char * const version, const char * const os);
-void cons_show_account_list(gchar **accounts);
-void cons_show_room_list(GSList *room, const char * const conference_node);
-void cons_show_bookmarks(const GList *list);
-void cons_show_disco_items(GSList *items, const char * const jid);
-void cons_show_disco_info(const char *from, GSList *identities, GSList *features);
-void cons_show_room_invite(const char * const invitor, const char * const room,
+void (*cons_show_account_list)(gchar **accounts);
+void (*cons_show_room_list)(GSList *room, const char * const conference_node);
+void (*cons_show_bookmarks)(const GList *list);
+void (*cons_show_disco_items)(GSList *items, const char * const jid);
+void (*cons_show_disco_info)(const char *from, GSList *identities, GSList *features);
+void (*cons_show_room_invite)(const char * const invitor, const char * const room,
     const char * const reason);
-void cons_check_version(gboolean not_available_msg);
-void cons_show_typing(const char * const barejid);
-void cons_show_incoming_message(const char * const short_from, const int win_index);
-void cons_show_room_invites(GSList *invites);
-void cons_show_received_subs(void);
-void cons_show_sent_subs(void);
-void cons_alert(void);
-void cons_theme_setting(void);
-void cons_beep_setting(void);
-void cons_flash_setting(void);
-void cons_splash_setting(void);
-void cons_vercheck_setting(void);
-void cons_mouse_setting(void);
-void cons_statuses_setting(void);
-void cons_titlebar_setting(void);
-void cons_notify_setting(void);
-void cons_show_desktop_prefs(void);
-void cons_states_setting(void);
-void cons_outtype_setting(void);
-void cons_intype_setting(void);
-void cons_gone_setting(void);
-void cons_history_setting(void);
-void cons_log_setting(void);
-void cons_chlog_setting(void);
-void cons_grlog_setting(void);
-void cons_autoaway_setting(void);
-void cons_reconnect_setting(void);
-void cons_autoping_setting(void);
-void cons_priority_setting(void);
-void cons_autoconnect_setting(void);
+void (*cons_check_version)(gboolean not_available_msg);
+void (*cons_show_typing)(const char * const barejid);
+void (*cons_show_incoming_message)(const char * const short_from, const int win_index);
+void (*cons_show_room_invites)(GSList *invites);
+void (*cons_show_received_subs)(void);
+void (*cons_show_sent_subs)(void);
+void (*cons_alert)(void);
+void (*cons_theme_setting)(void);
+void (*cons_beep_setting)(void);
+void (*cons_flash_setting)(void);
+void (*cons_splash_setting)(void);
+void (*cons_vercheck_setting)(void);
+void (*cons_mouse_setting)(void);
+void (*cons_statuses_setting)(void);
+void (*cons_titlebar_setting)(void);
+void (*cons_notify_setting)(void);
+void (*cons_show_desktop_prefs)(void);
+void (*cons_states_setting)(void);
+void (*cons_outtype_setting)(void);
+void (*cons_intype_setting)(void);
+void (*cons_gone_setting)(void);
+void (*cons_history_setting)(void);
+void (*cons_log_setting)(void);
+void (*cons_chlog_setting)(void);
+void (*cons_grlog_setting)(void);
+void (*cons_autoaway_setting)(void);
+void (*cons_reconnect_setting)(void);
+void (*cons_autoping_setting)(void);
+void (*cons_priority_setting)(void);
+void (*cons_autoconnect_setting)(void);
 
 // status bar actions
-void status_bar_refresh(void);
-void status_bar_resize(void);
-void status_bar_clear(void);
-void status_bar_clear_message(void);
-void status_bar_get_password(void);
-void status_bar_print_message(const char * const msg);
-void status_bar_inactive(const int win);
-void status_bar_active(const int win);
-void status_bar_new(const int win);
-void status_bar_update_time(void);
-void status_bar_set_all_inactive(void);
-void status_bar_current(int i);
+void (*status_bar_refresh)(void);
+void (*status_bar_resize)(void);
+void (*status_bar_clear)(void);
+void (*status_bar_clear_message)(void);
+void (*status_bar_get_password)(void);
+void (*status_bar_print_message)(const char * const msg);
+void (*status_bar_inactive)(const int win);
+void (*status_bar_active)(const int win);
+void (*status_bar_new)(const int win);
+void (*status_bar_set_all_inactive)(void);
+void (*status_bar_current)(int i);
 
 // input window actions
-wint_t inp_get_char(char *input, int *size);
-void inp_win_reset(void);
-void inp_win_resize(const char * input, const int size);
-void inp_put_back(void);
-void inp_non_block(void);
-void inp_block(void);
-void inp_get_password(char *passwd);
-void inp_replace_input(char *input, const char * const new_input, int *size);
+wint_t (*inp_get_char)(char *input, int *size);
+void (*inp_win_reset)(void);
+void (*inp_win_resize)(const char * input, const int size);
+void (*inp_put_back)(void);
+void (*inp_non_block)(void);
+void (*inp_block)(void);
+void (*inp_get_password)(char *passwd);
+void (*inp_replace_input)(char *input, const char * const new_input, int *size);
 
 // desktop notifier actions
-void notifier_init(void);
-void notifier_uninit(void);
+void (*notifier_init)(void);
+void (*notifier_uninit)(void);
 
-void notify_typing(const char * const handle);
-void notify_message(const char * const handle, int win);
-void notify_room_message(const char * const handle, const char * const room,
+void (*notify_typing)(const char * const handle);
+void (*notify_message)(const char * const handle, int win);
+void (*notify_room_message)(const char * const handle, const char * const room,
     int win);
-void notify_remind(void);
-void notify_invite(const char * const from, const char * const room,
+void (*notify_remind)(void);
+void (*notify_invite)(const char * const from, const char * const room,
     const char * const reason);
-void notify_subscription(const char * const from);
+void (*notify_subscription)(const char * const from);
 
 #endif
diff --git a/tests/test_cmd_account.c b/tests/test_cmd_account.c
index 0ef3c0ee..b2650d8e 100644
--- a/tests/test_cmd_account.c
+++ b/tests/test_cmd_account.c
@@ -33,6 +33,7 @@ void cmd_account_shows_usage_when_not_connected_and_no_args(void **state)
 
 void cmd_account_shows_account_when_connected_and_no_args(void **state)
 {
+    mock_cons_show_account();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     ProfAccount *account = malloc(sizeof(ProfAccount));
     gchar *args[] = { NULL };
@@ -43,7 +44,7 @@ void cmd_account_shows_account_when_connected_and_no_args(void **state)
     expect_any(accounts_get_account, name);
     will_return(accounts_get_account, account);
 
-    expect_memory(cons_show_account, account, account, sizeof(ProfAccount));
+    expect_cons_show_account(account);
 
     expect_any(accounts_free_account, account);
 
@@ -56,6 +57,7 @@ void cmd_account_shows_account_when_connected_and_no_args(void **state)
 
 void cmd_account_list_shows_accounts(void **state)
 {
+    mock_cons_show_account_list();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "list", NULL };
 
@@ -67,7 +69,7 @@ void cmd_account_list_shows_accounts(void **state)
 
     will_return(accounts_get_list, accounts);
 
-    expect_memory(cons_show_account_list, accounts, accounts, sizeof(accounts));
+    expect_cons_show_account_list(accounts);
 
     gboolean result = cmd_account(args, *help);
     assert_true(result);
@@ -110,6 +112,7 @@ void cmd_account_show_shows_message_when_account_does_not_exist(void **state)
 
 void cmd_account_show_shows_account_when_exists(void **state)
 {
+    mock_cons_show_account();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "show", "account_name", NULL };
     ProfAccount *account = malloc(sizeof(ProfAccount));
@@ -117,7 +120,7 @@ void cmd_account_show_shows_account_when_exists(void **state)
     expect_any(accounts_get_account, name);
     will_return(accounts_get_account, account);
 
-    expect_memory(cons_show_account, account, account, sizeof(ProfAccount));
+    expect_cons_show_account(account);
 
     expect_any(accounts_free_account, account);
 
diff --git a/tests/test_cmd_connect.c b/tests/test_cmd_connect.c
index f4545fb2..0095d144 100644
--- a/tests/test_cmd_connect.c
+++ b/tests/test_cmd_connect.c
@@ -85,6 +85,7 @@ void cmd_connect_shows_message_when_undefined(void **state)
 void cmd_connect_when_no_account(void **state)
 {
     mock_cons_show();
+    mock_ui_ask_password();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "user@server.org", NULL };
 
@@ -93,7 +94,7 @@ void cmd_connect_when_no_account(void **state)
     expect_string(accounts_get_account, name, "user@server.org");
     will_return(accounts_get_account, NULL);
 
-    will_return(ui_ask_password, strdup("password"));
+    mock_ui_ask_password_returns("password");
 
     expect_cons_show("Connecting as user@server.org");
 
@@ -110,6 +111,7 @@ void cmd_connect_when_no_account(void **state)
 
 void cmd_connect_with_altdomain_when_provided(void **state)
 {
+    stub_ui_ask_password();
     stub_cons_show();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "user@server.org", "altdomain" };
@@ -119,8 +121,6 @@ void cmd_connect_with_altdomain_when_provided(void **state)
     expect_any(accounts_get_account, name);
     will_return(accounts_get_account, NULL);
 
-    will_return(ui_ask_password, strdup("password"));
-
     jabber_connect_with_details = _mock_jabber_connect_with_details_altdomain;
     expect_string(_mock_jabber_connect_with_details_altdomain, altdomain, "altdomain");
     will_return(_mock_jabber_connect_with_details_altdomain, JABBER_CONNECTING);
@@ -134,6 +134,8 @@ void cmd_connect_with_altdomain_when_provided(void **state)
 void cmd_connect_fail_message(void **state)
 {
     stub_cons_show();
+    mock_cons_show_error();
+    stub_ui_ask_password();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "user@server.org", NULL };
 
@@ -142,12 +144,10 @@ void cmd_connect_fail_message(void **state)
     expect_any(accounts_get_account, name);
     will_return(accounts_get_account, NULL);
 
-    will_return(ui_ask_password, strdup("password"));
-
     jabber_connect_with_details = _mock_jabber_connect_with_details_result;
     will_return(_mock_jabber_connect_with_details_result, JABBER_DISCONNECTED);
 
-    expect_string(cons_show_error, output, "Connection attempt for user@server.org failed.");
+    expect_cons_show_error("Connection attempt for user@server.org failed.");
 
     gboolean result = cmd_connect(args, *help);
     assert_true(result);
@@ -158,6 +158,7 @@ void cmd_connect_fail_message(void **state)
 void cmd_connect_lowercases_argument(void **state)
 {
     stub_cons_show();
+    stub_ui_ask_password();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "USER@server.ORG", NULL };
 
@@ -166,8 +167,6 @@ void cmd_connect_lowercases_argument(void **state)
     expect_string(accounts_get_account, name, "user@server.org");
     will_return(accounts_get_account, NULL);
 
-    will_return(ui_ask_password, strdup("password"));
-
     jabber_connect_with_details = _mock_jabber_connect_with_details_result;
     will_return(_mock_jabber_connect_with_details_result, JABBER_CONNECTING);
 
@@ -180,6 +179,7 @@ void cmd_connect_lowercases_argument(void **state)
 void cmd_connect_asks_password_when_not_in_account(void **state)
 {
     stub_cons_show();
+    stub_ui_ask_password();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "jabber_org", NULL };
     ProfAccount *account = malloc(sizeof(ProfAccount));
@@ -192,8 +192,6 @@ void cmd_connect_asks_password_when_not_in_account(void **state)
 
     will_return(accounts_create_full_jid, strdup("user@jabber.org"));
 
-    will_return(ui_ask_password, strdup("password"));
-
     jabber_connect_with_account = _mock_jabber_connect_with_account_result;
     will_return(_mock_jabber_connect_with_account_result, JABBER_CONNECTING);
 
diff --git a/tests/ui/mock_ui.c b/tests/ui/mock_ui.c
index c70fbcf4..83119910 100644
--- a/tests/ui/mock_ui.c
+++ b/tests/ui/mock_ui.c
@@ -23,6 +23,7 @@
 #include <glib.h>
 #include <setjmp.h>
 #include <cmocka.h>
+#include <string.h>
 
 #include "ui/ui.h"
 
@@ -43,321 +44,116 @@ void _stub_cons_show(const char * const msg, ...)
 {
 }
 
-void
-mock_cons_show(void)
-{
-    cons_show = _mock_cons_show;
-    
-}
-
-void
-stub_cons_show(void)
-{
-    cons_show = _stub_cons_show;
-}
-
-void
-expect_cons_show(char *output)
-{
-    expect_string(_mock_cons_show, output, output);
-}
-
-void
-expect_cons_show_calls(int n)
+static
+void _mock_cons_show_error(const char * const msg, ...)
 {
-    expect_any_count(_mock_cons_show, output, n);
+    va_list args;
+    va_start(args, msg);
+    vsnprintf(output, sizeof(output), msg, args);
+    check_expected(output);
+    va_end(args);
 }
 
-// ui startup and control
-void ui_init(void) {}
-void ui_load_colours(void) {}
-void ui_refresh(void) {}
-void ui_close(void) {}
-void ui_resize(const int ch, const char * const input,
-    const int size) {}
-
-GSList* ui_get_recipients(void) 
+static
+void _mock_cons_show_account(ProfAccount *account)
 {
-    return (GSList *)mock();
+    check_expected(account);
 }
 
-void ui_handle_special_keys(const wint_t * const ch, const char * const inp,
-    const int size) {}
-void ui_switch_win(const int i) {}
-void ui_next_win(void) {}
-void ui_previous_win(void) {}
-
-unsigned long ui_get_idle_time(void) 
+static
+void _mock_cons_show_account_list(gchar **accounts)
 {
-    return (unsigned long)mock();
+    check_expected(accounts);
 }
 
-void ui_reset_idle_time(void) {}
-void ui_new_chat_win(const char * const to) {}
-void ui_print_error_from_recipient(const char * const from, const char *err_msg) {}
-void ui_print_system_msg_from_recipient(const char * const from, const char *message) {}
-void ui_handle_error_message(const char * const from, const char * const err_msg) {}
-
-gint ui_unread(void)
+static
+char * _mock_ui_ask_password(void)
 {
-    return (gint)mock();
+    return (char *)mock();    
 }
 
-void ui_close_connected_win(int index) {}
-
-int ui_close_all_wins(void)
+static
+char * _stub_ui_ask_password(void)
 {
-    return (int)mock();
+    return NULL;
 }
 
-int ui_close_read_wins(void)
+void
+mock_cons_show(void)
 {
-    return (int)mock();
+    cons_show = _mock_cons_show;
+    
 }
 
-// current window actions
-void ui_close_current(void) {}
-void ui_clear_current(void) {}
-
-win_type_t ui_current_win_type(void)
+void
+mock_cons_show_error(void)
 {
-    return (win_type_t)mock();
+    cons_show_error = _mock_cons_show_error;
 }
 
-int ui_current_win_index(void)
+void
+mock_cons_show_account(void)
 {
-    return (int)mock();
+    cons_show_account = _mock_cons_show_account;
 }
 
-char* ui_current_recipient(void)
+void
+mock_cons_show_account_list(void)
 {
-    return (char *)mock();
+    cons_show_account_list = _mock_cons_show_account_list;
 }
 
-void ui_current_print_line(const char * const msg, ...) {}
-void ui_current_error_line(const char * const msg) {}
-void ui_current_page_off(void) {}
 
-win_type_t ui_win_type(int index)
-{
-    return (win_type_t)mock();
-}
-
-char * ui_recipient(int index)
+void
+mock_ui_ask_password(void)
 {
-    return (char *)mock();
+    ui_ask_password = _mock_ui_ask_password;
 }
 
-void ui_close_win(int index) {}
-
-gboolean ui_win_exists(int index)
+void
+stub_ui_ask_password(void)
 {
-    return (gboolean)mock();
+    ui_ask_password = _stub_ui_ask_password;
 }
 
-int ui_win_unread(int index)
+void
+stub_cons_show(void)
 {
-    return (int)mock();
+    cons_show = _stub_cons_show;
 }
 
-// ui events
-void ui_contact_typing(const char * const from) {}
-void ui_incoming_msg(const char * const from, const char * const message,
-    GTimeVal *tv_stamp, gboolean priv) {}
-void ui_contact_online(const char * const barejid, const char * const resource,
-    const char * const show, const char * const status, GDateTime *last_activity) {}
-void ui_contact_offline(const char * const from, const char * const show,
-    const char * const status) {}
-void ui_disconnected(void) {}
-void ui_recipient_gone(const char * const barejid) {}
-void ui_outgoing_msg(const char * const from, const char * const to,
-    const char * const message) {}
-void ui_room_join(Jid *jid) {}
-void ui_room_roster(const char * const room, GList *roster, const char * const presence) {}
-void ui_room_history(const char * const room_jid, const char * const nick,
-    GTimeVal tv_stamp, const char * const message) {}
-void ui_room_message(const char * const room_jid, const char * const nick,
-    const char * const message) {}
-void ui_room_subject(const char * const room_jid,
-    const char * const subject) {}
-void ui_room_broadcast(const char * const room_jid,
-    const char * const message) {}
-void ui_room_member_offline(const char * const room, const char * const nick) {}
-void ui_room_member_online(const char * const room,
-    const char * const nick, const char * const show, const char * const status) {}
-void ui_room_member_nick_change(const char * const room,
-    const char * const old_nick, const char * const nick) {}
-void ui_room_nick_change(const char * const room, const char * const nick) {}
-void ui_room_member_presence(const char * const room,
-    const char * const nick, const char * const show, const char * const status) {}
-void ui_roster_add(const char * const barejid, const char * const name) {}
-void ui_roster_remove(const char * const barejid) {}
-void ui_contact_already_in_group(const char * const contact, const char * const group) {}
-void ui_contact_not_in_group(const char * const contact, const char * const group) {}
-void ui_group_added(const char * const contact, const char * const group) {}
-void ui_group_removed(const char * const contact, const char * const group) {}
-
-// contact status functions
-void ui_status_room(const char * const contact) {}
-void ui_status(void) {}
-void ui_status_private(void) {}
-
-void ui_create_duck_win(void) {}
-void ui_open_duck_win(void) {}
-void ui_duck(const char * const query) {}
-void ui_duck_result(const char * const result) {}
-
-gboolean ui_duck_exists(void)
+void
+expect_cons_show(char *output)
 {
-    return (gboolean)mock();
+    expect_string(_mock_cons_show, output, output);
 }
 
-void ui_tidy_wins(void) {}
-void ui_prune_wins(void) {}
-
-char * ui_ask_password(void)
+void
+expect_cons_show_calls(int n)
 {
-    return (char *)mock();
+    expect_any_count(_mock_cons_show, output, n);
 }
 
-// create windows
-void create_title_bar(void) {}
-void create_status_bar(void) {}
-void create_input_window(void) {}
-
-// title bar actions
-void title_bar_refresh(void) {}
-void title_bar_resize(void) {}
-void title_bar_show(const char * const title) {}
-void title_bar_title(void) {}
-void title_bar_set_status(contact_presence_t status) {}
-void title_bar_set_recipient(const char * const from) {}
-void title_bar_set_typing(gboolean is_typing) {}
-void title_bar_draw(void) {}
-
-// console window actions
-void cons_about(void) {}
-void cons_help(void) {}
-void cons_basic_help(void) {}
-void cons_settings_help(void) {}
-void cons_presence_help(void) {}
-void cons_navigation_help(void) {}
-void cons_prefs(void) {}
-void cons_show_ui_prefs(void) {}
-void cons_show_desktop_prefs(void) {}
-void cons_show_chat_prefs(void) {}
-void cons_show_log_prefs(void) {}
-void cons_show_presence_prefs(void) {}
-void cons_show_connection_prefs(void) {}
-
-void cons_show_account(ProfAccount *account)
+void
+expect_cons_show_error(char *output)
 {
-    check_expected(account);
+    expect_string(_mock_cons_show_error, output, output);
 }
 
-void cons_debug(const char * const msg, ...) {}
-void cons_show_time(void) {}
-void cons_show_word(const char * const word) {}
-
-void cons_show_error(const char * const cmd, ...)
+void
+expect_cons_show_account(ProfAccount *account)
 {
-    va_list args;
-    va_start(args, cmd);
-    vsnprintf(output, sizeof(output), cmd, args);
-    check_expected(output);
-    va_end(args);
+    expect_memory(_mock_cons_show_account, account, account, sizeof(ProfAccount));
 }
 
-void cons_highlight_show(const char * const cmd) {}
-void cons_show_contacts(GSList * list) {}
-void cons_show_roster(GSList * list) {}
-void cons_show_roster_group(const char * const group, GSList * list) {}
-void cons_show_wins(void) {}
-void cons_show_status(const char * const barejid) {}
-void cons_show_info(PContact pcontact) {}
-void cons_show_caps(const char * const contact, Resource *resource) {}
-void cons_show_themes(GSList *themes) {}
-void cons_show_login_success(ProfAccount *account) {}
-void cons_show_software_version(const char * const jid,
-    const char * const presence, const char * const name,
-    const char * const version, const char * const os) {}
-
-void cons_show_account_list(gchar **accounts)
+void
+expect_cons_show_account_list(gchar **accounts)
 {
-    check_expected(accounts);
+    expect_memory(_mock_cons_show_account_list, accounts, accounts, sizeof(accounts));
 }
 
-void cons_show_room_list(GSList *room, const char * const conference_node) {}
-void cons_show_bookmarks(const GList *list) {}
-void cons_show_disco_items(GSList *items, const char * const jid) {}
-void cons_show_disco_info(const char *from, GSList *identities, GSList *features) {}
-void cons_show_room_invite(const char * const invitor, const char * const room,
-    const char * const reason) {}
-void cons_check_version(gboolean not_available_msg) {}
-void cons_show_typing(const char * const barejid) {}
-void cons_show_incoming_message(const char * const short_from, const int win_index) {}
-void cons_show_room_invites(GSList *invites) {}
-void cons_show_received_subs(void) {}
-void cons_show_sent_subs(void) {}
-void cons_alert(void) {}
-void cons_theme_setting(void) {}
-void cons_beep_setting(void) {}
-void cons_flash_setting(void) {}
-void cons_splash_setting(void) {}
-void cons_vercheck_setting(void) {}
-void cons_mouse_setting(void) {}
-void cons_statuses_setting(void) {}
-void cons_titlebar_setting(void) {}
-void cons_notify_setting(void) {}
-void cons_states_setting(void) {}
-void cons_outtype_setting(void) {}
-void cons_intype_setting(void) {}
-void cons_gone_setting(void) {}
-void cons_history_setting(void) {}
-void cons_log_setting(void) {}
-void cons_chlog_setting(void) {}
-void cons_grlog_setting(void) {}
-void cons_autoaway_setting(void) {}
-void cons_reconnect_setting(void) {}
-void cons_autoping_setting(void) {}
-void cons_priority_setting(void) {}
-void cons_autoconnect_setting(void) {}
-
-// status bar actions
-void status_bar_refresh(void) {}
-void status_bar_resize(void) {}
-void status_bar_clear(void) {}
-void status_bar_clear_message(void) {}
-void status_bar_get_password(void) {}
-void status_bar_print_message(const char * const msg) {}
-void status_bar_inactive(const int win) {}
-void status_bar_active(const int win) {}
-void status_bar_new(const int win) {}
-void status_bar_update_time(void) {}
-void status_bar_set_all_inactive(void) {}
-void status_bar_current(int i) {}
-
-// input window actions
-wint_t inp_get_char(char *input, int *size)
+void
+mock_ui_ask_password_returns(char *password)
 {
-    return (wint_t)mock();
+    will_return(_mock_ui_ask_password, strdup(password));
 }
-void inp_win_reset(void) {}
-void inp_win_resize(const char * input, const int size) {}
-void inp_put_back(void) {}
-void inp_non_block(void) {}
-void inp_block(void) {}
-void inp_get_password(char *passwd) {}
-void inp_replace_input(char *input, const char * const new_input, int *size) {}
-
-void notifier_init(void) {}
-void notifier_uninit(void) {}
-
-void notify_typing(const char * const handle) {}
-void notify_message(const char * const handle, int win) {}
-void notify_room_message(const char * const handle, const char * const room,
-    int win) {}
-void notify_remind(void) {}
-void notify_invite(const char * const from, const char * const room,
-    const char * const reason) {}
-void notify_subscription(const char * const from) {}
diff --git a/tests/ui/mock_ui.h b/tests/ui/mock_ui.h
index 76d15614..2833be29 100644
--- a/tests/ui/mock_ui.h
+++ b/tests/ui/mock_ui.h
@@ -11,4 +11,17 @@ void mock_cons_show(void);
 void expect_cons_show(char *output);
 void expect_cons_show_calls(int n);
 
+void mock_cons_show_error(void);
+void expect_cons_show_error(char *output);
+
+void mock_cons_show_account(void);
+void expect_cons_show_account(ProfAccount *account);
+
+void mock_cons_show_account_list(void);
+void expect_cons_show_account_list(gchar **accounts);
+
+void stub_ui_ask_password(void);
+void mock_ui_ask_password(void);
+void mock_ui_ask_password_returns(char *password);
+
 #endif