1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Remove win_print, use win_printf instead

This commit is contained in:
James Booth 2016-10-11 23:38:59 +01:00
parent 0337c5b22c
commit 0890179fc4
13 changed files with 230 additions and 242 deletions

View File

@ -1481,7 +1481,7 @@ _cmd_help_cmd_list(const char *const tag)
if (tag) { if (tag) {
win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "%s commands", tag); win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "%s commands", tag);
} else { } else {
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "All commands"); win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "All commands");
} }
GList *ordered_commands = NULL; GList *ordered_commands = NULL;
@ -3942,7 +3942,7 @@ cmd_subject(ProfWin *window, const char *const command, gchar **args)
win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: "); win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: ");
win_printf(window, '!', 0, NULL, NO_DATE, 0, "", "%s", subject); win_printf(window, '!', 0, NULL, NO_DATE, 0, "", "%s", subject);
} else { } else {
win_print(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room has no subject"); win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room has no subject");
} }
return TRUE; return TRUE;
} }
@ -4050,7 +4050,7 @@ cmd_affiliation(ProfWin *window, const char *const command, gchar **args)
iq_room_affiliation_list(mucwin->roomjid, "member"); iq_room_affiliation_list(mucwin->roomjid, "member");
iq_room_affiliation_list(mucwin->roomjid, "outcast"); iq_room_affiliation_list(mucwin->roomjid, "outcast");
} else if (g_strcmp0(affiliation, "none") == 0) { } else if (g_strcmp0(affiliation, "none") == 0) {
win_print((ProfWin*) mucwin, '!', 0, NULL, 0, 0, "", "Cannot list users with no affiliation."); win_printf((ProfWin*) mucwin, '!', 0, NULL, 0, 0, "", "Cannot list users with no affiliation.");
} else { } else {
iq_room_affiliation_list(mucwin->roomjid, affiliation); iq_room_affiliation_list(mucwin->roomjid, affiliation);
} }
@ -4118,7 +4118,7 @@ cmd_role(ProfWin *window, const char *const command, gchar **args)
iq_room_role_list(mucwin->roomjid, "participant"); iq_room_role_list(mucwin->roomjid, "participant");
iq_room_role_list(mucwin->roomjid, "visitor"); iq_room_role_list(mucwin->roomjid, "visitor");
} else if (g_strcmp0(role, "none") == 0) { } else if (g_strcmp0(role, "none") == 0) {
win_print((ProfWin*) mucwin, '!', 0, NULL, 0, 0, "", "Cannot list users with no role."); win_printf((ProfWin*) mucwin, '!', 0, NULL, 0, 0, "", "Cannot list users with no role.");
} else { } else {
iq_room_role_list(mucwin->roomjid, role); iq_room_role_list(mucwin->roomjid, role);
} }
@ -4180,12 +4180,12 @@ cmd_room(ProfWin *window, const char *const command, gchar **args)
if (g_strcmp0(args[0], "accept") == 0) { if (g_strcmp0(args[0], "accept") == 0) {
gboolean requires_config = muc_requires_config(mucwin->roomjid); gboolean requires_config = muc_requires_config(mucwin->roomjid);
if (!requires_config) { if (!requires_config) {
win_print(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Current room does not require configuration."); win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Current room does not require configuration.");
return TRUE; return TRUE;
} else { } else {
iq_confirm_instant_room(mucwin->roomjid); iq_confirm_instant_room(mucwin->roomjid);
muc_set_requires_config(mucwin->roomjid, FALSE); muc_set_requires_config(mucwin->roomjid, FALSE);
win_print(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room unlocked."); win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room unlocked.");
return TRUE; return TRUE;
} }
} }
@ -4687,7 +4687,7 @@ cmd_tiny(ProfWin *window, const char *const command, gchar **args)
char *tiny = tinyurl_get(url); char *tiny = tinyurl_get(url);
if (!tiny) { if (!tiny) {
win_print(window, '-', 0, NULL, 0, THEME_ERROR, "", "Couldn't create tinyurl."); win_printf(window, '-', 0, NULL, 0, THEME_ERROR, "", "Couldn't create tinyurl.");
return TRUE; return TRUE;
} }

View File

@ -85,7 +85,7 @@ api_cons_show_themed(const char *const group, const char *const key, const char
char *parsed = str_replace(message, "\r\n", "\n"); char *parsed = str_replace(message, "\r\n", "\n");
theme_item_t themeitem = plugin_themes_get(group, key, def); theme_item_t themeitem = plugin_themes_get(group, key, def);
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
win_print(console, '-', 0, NULL, 0, themeitem, "", parsed); win_printf(console, '-', 0, NULL, 0, themeitem, "", parsed);
free(parsed); free(parsed);
@ -368,7 +368,7 @@ api_win_show(const char *tag, const char *line)
} }
ProfWin *window = (ProfWin*)pluginwin; ProfWin *window = (ProfWin*)pluginwin;
win_print(window, '!', 0, NULL, 0, 0, "", line); win_printf(window, '!', 0, NULL, 0, 0, "", line);
return 1; return 1;
} }
@ -393,7 +393,7 @@ api_win_show_themed(const char *tag, const char *const group, const char *const
theme_item_t themeitem = plugin_themes_get(group, key, def); theme_item_t themeitem = plugin_themes_get(group, key, def);
ProfWin *window = (ProfWin*)pluginwin; ProfWin *window = (ProfWin*)pluginwin;
win_print(window, '!', 0, NULL, 0, themeitem, "", line); win_printf(window, '!', 0, NULL, 0, themeitem, "", line);
return 1; return 1;
} }

View File

@ -96,9 +96,9 @@ chatwin_otr_secured(ProfChatWin *chatwin, gboolean trusted)
ProfWin *window = (ProfWin*) chatwin; ProfWin *window = (ProfWin*) chatwin;
if (trusted) { if (trusted) {
win_print(window, '!', 0, NULL, 0, THEME_OTR_STARTED_TRUSTED, "", "OTR session started (trusted)."); win_printf(window, '!', 0, NULL, 0, THEME_OTR_STARTED_TRUSTED, "", "OTR session started (trusted).");
} else { } else {
win_print(window, '!', 0, NULL, 0, THEME_OTR_STARTED_UNTRUSTED, "", "OTR session started (untrusted)."); win_printf(window, '!', 0, NULL, 0, THEME_OTR_STARTED_UNTRUSTED, "", "OTR session started (untrusted).");
} }
if (wins_is_current(window)) { if (wins_is_current(window)) {
@ -125,7 +125,7 @@ chatwin_otr_unsecured(ProfChatWin *chatwin)
chatwin->otr_is_trusted = FALSE; chatwin->otr_is_trusted = FALSE;
ProfWin *window = (ProfWin*)chatwin; ProfWin *window = (ProfWin*)chatwin;
win_print(window, '!', 0, NULL, 0, THEME_OTR_ENDED, "", "OTR session ended."); win_printf(window, '!', 0, NULL, 0, THEME_OTR_ENDED, "", "OTR session ended.");
if (wins_is_current(window)) { if (wins_is_current(window)) {
title_bar_switch(); title_bar_switch();
} }
@ -188,7 +188,7 @@ chatwin_otr_trust(ProfChatWin *chatwin)
chatwin->otr_is_trusted = TRUE; chatwin->otr_is_trusted = TRUE;
ProfWin *window = (ProfWin*)chatwin; ProfWin *window = (ProfWin*)chatwin;
win_print(window, '!', 0, NULL, 0, THEME_OTR_TRUSTED, "", "OTR session trusted."); win_printf(window, '!', 0, NULL, 0, THEME_OTR_TRUSTED, "", "OTR session trusted.");
if (wins_is_current(window)) { if (wins_is_current(window)) {
title_bar_switch(); title_bar_switch();
} }
@ -203,7 +203,7 @@ chatwin_otr_untrust(ProfChatWin *chatwin)
chatwin->otr_is_trusted = FALSE; chatwin->otr_is_trusted = FALSE;
ProfWin *window = (ProfWin*)chatwin; ProfWin *window = (ProfWin*)chatwin;
win_print(window, '!', 0, NULL, 0, THEME_OTR_UNTRUSTED, "", "OTR session untrusted."); win_printf(window, '!', 0, NULL, 0, THEME_OTR_UNTRUSTED, "", "OTR session untrusted.");
if (wins_is_current(window)) { if (wins_is_current(window)) {
title_bar_switch(); title_bar_switch();
} }
@ -308,7 +308,7 @@ chatwin_outgoing_msg(ProfChatWin *chatwin, const char *const message, char *id,
if (request_receipt && id) { if (request_receipt && id) {
win_print_with_receipt((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message, id); win_print_with_receipt((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message, id);
} else { } else {
win_print((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message); win_printf((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message);
} }
} }
@ -322,7 +322,7 @@ chatwin_outgoing_carbon(ProfChatWin *chatwin, const char *const message, prof_en
enc_char = prefs_get_pgp_char(); enc_char = prefs_get_pgp_char();
} }
win_print((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message); win_printf((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message);
int num = wins_get_num((ProfWin*)chatwin); int num = wins_get_num((ProfWin*)chatwin);
status_bar_active(num); status_bar_active(num);
} }
@ -401,11 +401,11 @@ _chatwin_history(ProfChatWin *chatwin, const char *const contact)
char mm[3]; memcpy(mm, &line[3], 2); mm[2] = '\0'; int imm = atoi(mm); char mm[3]; memcpy(mm, &line[3], 2); mm[2] = '\0'; int imm = atoi(mm);
char ss[3]; memcpy(ss, &line[6], 2); ss[2] = '\0'; int iss = atoi(ss); char ss[3]; memcpy(ss, &line[6], 2); ss[2] = '\0'; int iss = atoi(ss);
GDateTime *timestamp = g_date_time_new_local(2000, 1, 1, ihh, imm, iss); GDateTime *timestamp = g_date_time_new_local(2000, 1, 1, ihh, imm, iss);
win_print((ProfWin*)chatwin, '-', 0, timestamp, NO_COLOUR_DATE, 0, "", curr->data+11); win_printf((ProfWin*)chatwin, '-', 0, timestamp, NO_COLOUR_DATE, 0, "", curr->data+11);
g_date_time_unref(timestamp); g_date_time_unref(timestamp);
// header // header
} else { } else {
win_print((ProfWin*)chatwin, '-', 0, NULL, 0, 0, "", curr->data); win_printf((ProfWin*)chatwin, '-', 0, NULL, 0, 0, "", curr->data);
} }
curr = g_slist_next(curr); curr = g_slist_next(curr);
} }

View File

@ -67,14 +67,14 @@ void
cons_show_time(void) cons_show_time(void)
{ {
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
win_print(console, '-', 0, NULL, NO_EOL, 0, "", ""); win_printf(console, '-', 0, NULL, NO_EOL, 0, "", "");
} }
void void
cons_show_word(const char *const word) cons_show_word(const char *const word)
{ {
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", word); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", word);
} }
void void
@ -125,19 +125,19 @@ cons_show_help(const char *const cmd, CommandHelp *help)
cons_show(""); cons_show("");
win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "%s", &cmd[1]); win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "%s", &cmd[1]);
win_print(console, '-', 0, NULL, NO_EOL, THEME_WHITE_BOLD, "", ""); win_printf(console, '-', 0, NULL, NO_EOL, THEME_WHITE_BOLD, "", "");
int i; int i;
for (i = 0; i < strlen(cmd) - 1 ; i++) { for (i = 0; i < strlen(cmd) - 1 ; i++) {
win_print(console, '-', 0, NULL, NO_EOL | NO_DATE, THEME_WHITE_BOLD, "", "-"); win_printf(console, '-', 0, NULL, NO_EOL | NO_DATE, THEME_WHITE_BOLD, "", "-");
} }
win_print(console, '-', 0, NULL, NO_DATE, THEME_WHITE_BOLD, "", ""); win_printf(console, '-', 0, NULL, NO_DATE, THEME_WHITE_BOLD, "", "");
cons_show(""); cons_show("");
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Synopsis"); win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Synopsis");
ui_show_lines(console, help->synopsis); ui_show_lines(console, help->synopsis);
cons_show(""); cons_show("");
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Description"); win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Description");
win_println(console, 0, help->desc); win_println(console, 0, help->desc);
int maxlen = 0; int maxlen = 0;
@ -148,7 +148,7 @@ cons_show_help(const char *const cmd, CommandHelp *help)
if (i > 0) { if (i > 0) {
cons_show(""); cons_show("");
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Arguments"); win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Arguments");
for (i = 0; help->args[i][0] != NULL; i++) { for (i = 0; help->args[i][0] != NULL; i++) {
win_printf(console, '-', maxlen + 3, NULL, 0, 0, "", "%-*s: %s", maxlen + 1, help->args[i][0], help->args[i][1]); win_printf(console, '-', maxlen + 3, NULL, 0, 0, "", "%-*s: %s", maxlen + 1, help->args[i][0], help->args[i][1]);
} }
@ -156,7 +156,7 @@ cons_show_help(const char *const cmd, CommandHelp *help)
if (g_strv_length((gchar**)help->examples) > 0) { if (g_strv_length((gchar**)help->examples) > 0) {
cons_show(""); cons_show("");
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Examples"); win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Examples");
ui_show_lines(console, help->examples); ui_show_lines(console, help->examples);
} }
} }
@ -181,7 +181,7 @@ cons_show_error(const char *const msg, ...)
va_start(arg, msg); va_start(arg, msg);
GString *fmt_msg = g_string_new(NULL); GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg); g_string_vprintf(fmt_msg, msg, arg);
win_print(console, '-', 0, NULL, 0, THEME_ERROR, "", fmt_msg->str); win_printf(console, '-', 0, NULL, 0, THEME_ERROR, "", fmt_msg->str);
g_string_free(fmt_msg, TRUE); g_string_free(fmt_msg, TRUE);
va_end(arg); va_end(arg);
@ -484,7 +484,7 @@ cons_show_login_success(ProfAccount *account, gboolean secured)
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", presence_str); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", presence_str);
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " (priority %d)", win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " (priority %d)",
accounts_get_priority_for_presence_type(account->name, presence)); accounts_get_priority_for_presence_type(account->name, presence));
win_print(console, '-', 0, NULL, NO_DATE, 0, "", "."); win_printf(console, '-', 0, NULL, NO_DATE, 0, "", ".");
if (!secured) { if (!secured) {
cons_show_error("TLS connection not established"); cons_show_error("TLS connection not established");
} }
@ -555,26 +555,26 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence)
theme_item_t presence_colour = theme_main_presence_attrs(resource_presence); theme_item_t presence_colour = theme_main_presence_attrs(resource_presence);
win_printf(console, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", fulljid); win_printf(console, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", fulljid);
win_print(console, '-', 0, NULL, NO_DATE, 0, "", ":"); win_printf(console, '-', 0, NULL, NO_DATE, 0, "", ":");
// show identity // show identity
if (caps->identity) { if (caps->identity) {
DiscoIdentity *identity = caps->identity; DiscoIdentity *identity = caps->identity;
win_print(console, '-', 0, NULL, NO_EOL, 0, "", "Identity: "); win_printf(console, '-', 0, NULL, NO_EOL, 0, "", "Identity: ");
if (identity->name) { if (identity->name) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name);
if (identity->category || identity->type) { if (identity->category || identity->type) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " "); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
} }
} }
if (identity->type) { if (identity->type) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type);
if (identity->category) { if (identity->category) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " "); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
} }
} }
if (identity->category) { if (identity->category) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category);
} }
win_newline(console); win_newline(console);
} }
@ -706,10 +706,10 @@ cons_show_bookmarks(const GList *list)
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "/%s", item->nick); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "/%s", item->nick);
} }
if (item->autojoin) { if (item->autojoin) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (autojoin)"); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (autojoin)");
} }
if (item->password) { if (item->password) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (private)"); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (private)");
} }
if (muc_active(item->barejid)) { if (muc_active(item->barejid)) {
ProfWin *roomwin = (ProfWin*)wins_get_muc(item->barejid); ProfWin *roomwin = (ProfWin*)wins_get_muc(item->barejid);
@ -1014,21 +1014,21 @@ cons_show_account(ProfAccount *account)
// show identity // show identity
if (caps->identity) { if (caps->identity) {
DiscoIdentity *identity = caps->identity; DiscoIdentity *identity = caps->identity;
win_print(console, '-', 0, NULL, NO_EOL, 0, "", " Identity: "); win_printf(console, '-', 0, NULL, NO_EOL, 0, "", " Identity: ");
if (identity->name) { if (identity->name) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name);
if (identity->category || identity->type) { if (identity->category || identity->type) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " "); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
} }
} }
if (identity->type) { if (identity->type) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type);
if (identity->category) { if (identity->category) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " "); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
} }
} }
if (identity->category) { if (identity->category) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category);
} }
win_newline(console); win_newline(console);
} }
@ -2078,7 +2078,7 @@ cons_navigation_help(void)
{ {
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
cons_show(""); cons_show("");
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Navigation"); win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Navigation");
cons_show("Alt-1..Alt-0, F1..F10 : Choose window."); cons_show("Alt-1..Alt-0, F1..F10 : Choose window.");
cons_show("Alt-LEFT, Alt-RIGHT : Previous/next chat window."); cons_show("Alt-LEFT, Alt-RIGHT : Previous/next chat window.");
cons_show("PAGEUP, PAGEDOWN : Page the main window."); cons_show("PAGEUP, PAGEDOWN : Page the main window.");
@ -2184,15 +2184,15 @@ _cons_theme_bar_prop(theme_item_t theme, char *prop)
GString *propstr = g_string_new(" "); GString *propstr = g_string_new(" ");
g_string_append_printf(propstr, "%-24s", prop); g_string_append_printf(propstr, "%-24s", prop);
win_print(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", propstr->str); win_printf(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", propstr->str);
g_string_free(propstr, TRUE); g_string_free(propstr, TRUE);
GString *valstr = g_string_new(" "); GString *valstr = g_string_new(" ");
char *setting = theme_get_string(prop); char *setting = theme_get_string(prop);
g_string_append_printf(valstr, "%s ", setting); g_string_append_printf(valstr, "%s ", setting);
theme_free_string(setting); theme_free_string(setting);
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, theme, "", valstr->str); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, theme, "", valstr->str);
win_print(console, '-', 0, NULL, NO_DATE, THEME_TEXT, "", ""); win_printf(console, '-', 0, NULL, NO_DATE, THEME_TEXT, "", "");
g_string_free(valstr, TRUE); g_string_free(valstr, TRUE);
} }
@ -2203,22 +2203,15 @@ _cons_theme_prop(theme_item_t theme, char *prop)
GString *propstr = g_string_new(" "); GString *propstr = g_string_new(" ");
g_string_append_printf(propstr, "%-24s", prop); g_string_append_printf(propstr, "%-24s", prop);
win_print(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", propstr->str); win_printf(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", propstr->str);
g_string_free(propstr, TRUE); g_string_free(propstr, TRUE);
GString *valstr = g_string_new(""); GString *valstr = g_string_new("");
char *setting = theme_get_string(prop); char *setting = theme_get_string(prop);
g_string_append_printf(valstr, "%s", setting); g_string_append_printf(valstr, "%s", setting);
theme_free_string(setting); theme_free_string(setting);
win_print(console, '-', 0, NULL, NO_DATE, theme, "", valstr->str); win_printf(console, '-', 0, NULL, NO_DATE, theme, "", valstr->str);
g_string_free(valstr, TRUE); g_string_free(valstr, TRUE);
// GString *str = g_string_new(" ");
// char *setting = theme_get_string(prop);
// g_string_append_printf(str, "%-24s%s", prop, setting);
// theme_free_string(setting);
// win_print(console, '-', 0, NULL, 0, theme, "", str->str);
// g_string_free(str, TRUE);
} }
void void
@ -2332,22 +2325,22 @@ cons_theme_colours(void)
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
cons_show("Available colours:"); cons_show("Available colours:");
win_print(console, '-', 0, NULL, NO_EOL, THEME_WHITE, "", " white "); win_printf(console, '-', 0, NULL, NO_EOL, THEME_WHITE, "", " white ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_WHITE_BOLD, "", " bold_white"); win_printf(console, '-', 0, NULL, NO_DATE, THEME_WHITE_BOLD, "", " bold_white");
win_print(console, '-', 0, NULL, NO_EOL, THEME_GREEN, "", " green "); win_printf(console, '-', 0, NULL, NO_EOL, THEME_GREEN, "", " green ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_GREEN_BOLD, "", " bold_green"); win_printf(console, '-', 0, NULL, NO_DATE, THEME_GREEN_BOLD, "", " bold_green");
win_print(console, '-', 0, NULL, NO_EOL, THEME_RED, "", " red "); win_printf(console, '-', 0, NULL, NO_EOL, THEME_RED, "", " red ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_RED_BOLD, "", " bold_red"); win_printf(console, '-', 0, NULL, NO_DATE, THEME_RED_BOLD, "", " bold_red");
win_print(console, '-', 0, NULL, NO_EOL, THEME_YELLOW, "", " yellow "); win_printf(console, '-', 0, NULL, NO_EOL, THEME_YELLOW, "", " yellow ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_YELLOW_BOLD, "", " bold_yellow"); win_printf(console, '-', 0, NULL, NO_DATE, THEME_YELLOW_BOLD, "", " bold_yellow");
win_print(console, '-', 0, NULL, NO_EOL, THEME_BLUE, "", " blue "); win_printf(console, '-', 0, NULL, NO_EOL, THEME_BLUE, "", " blue ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_BLUE_BOLD, "", " bold_blue"); win_printf(console, '-', 0, NULL, NO_DATE, THEME_BLUE_BOLD, "", " bold_blue");
win_print(console, '-', 0, NULL, NO_EOL, THEME_CYAN, "", " cyan "); win_printf(console, '-', 0, NULL, NO_EOL, THEME_CYAN, "", " cyan ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_CYAN_BOLD, "", " bold_cyan"); win_printf(console, '-', 0, NULL, NO_DATE, THEME_CYAN_BOLD, "", " bold_cyan");
win_print(console, '-', 0, NULL, NO_EOL, THEME_MAGENTA, "", " magenta "); win_printf(console, '-', 0, NULL, NO_EOL, THEME_MAGENTA, "", " magenta ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_MAGENTA_BOLD, "", " bold_magenta"); win_printf(console, '-', 0, NULL, NO_DATE, THEME_MAGENTA_BOLD, "", " bold_magenta");
win_print(console, '-', 0, NULL, NO_EOL, THEME_BLACK, "", " black "); win_printf(console, '-', 0, NULL, NO_EOL, THEME_BLACK, "", " black ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_BLACK_BOLD, "", " bold_black"); win_printf(console, '-', 0, NULL, NO_DATE, THEME_BLACK_BOLD, "", " bold_black");
cons_show(""); cons_show("");
} }
@ -2357,14 +2350,14 @@ _cons_splash_logo(void)
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
win_println(console, 0, "Welcome to"); win_println(console, 0, "Welcome to");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", " ___ _ "); win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", " ___ _ ");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", " / __) (_)_ "); win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", " / __) (_)_ ");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", " ____ ____ ___ | |__ ____ ____ _| |_ _ _ "); win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", " ____ ____ ___ | |__ ____ ____ _| |_ _ _ ");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| _ \\ / ___) _ \\| __) _ | _ \\| | _) | | |"); win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| _ \\ / ___) _ \\| __) _ | _ \\| | _) | | |");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| | | | | | |_| | | ( ( | | | | | | |_| |_| |"); win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| | | | | | |_| | | ( ( | | | | | | |_| |_| |");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| ||_/|_| \\___/|_| \\_||_|_| |_|_|\\___)__ |"); win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| ||_/|_| \\___/|_| \\_||_|_| |_|_|\\___)__ |");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", "|_| (____/ "); win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", "|_| (____/ ");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", ""); win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", "");
if (strcmp(PACKAGE_STATUS, "development") == 0) { if (strcmp(PACKAGE_STATUS, "development") == 0) {
#ifdef HAVE_GIT_VERSION #ifdef HAVE_GIT_VERSION
@ -2404,7 +2397,7 @@ _show_roster_contacts(GSList *list, gboolean show_groups)
g_string_free(title, TRUE); g_string_free(title, TRUE);
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " - "); win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " - ");
GString *sub = g_string_new(""); GString *sub = g_string_new("");
sub = g_string_append(sub, p_contact_subscription(contact)); sub = g_string_append(sub, p_contact_subscription(contact));
if (p_contact_pending_out(contact)) { if (p_contact_pending_out(contact)) {
@ -2441,7 +2434,7 @@ _show_roster_contacts(GSList *list, gboolean show_groups)
win_printf(console, '-', 0, NULL, NO_DATE, 0, "", "%s", groups_str->str); win_printf(console, '-', 0, NULL, NO_DATE, 0, "", "%s", groups_str->str);
g_string_free(groups_str, TRUE); g_string_free(groups_str, TRUE);
} else { } else {
win_print(console, '-', 0, NULL, NO_DATE, 0, "", " "); win_printf(console, '-', 0, NULL, NO_DATE, 0, "", " ");
} }
} }

View File

@ -435,7 +435,7 @@ ui_handle_otr_error(const char *const barejid, const char *const message)
{ {
ProfChatWin *chatwin = wins_get_chat(barejid); ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) { if (chatwin) {
win_print((ProfWin*)chatwin, '!', 0, NULL, 0, THEME_ERROR, "", message); win_printf((ProfWin*)chatwin, '!', 0, NULL, 0, THEME_ERROR, "", message);
} else { } else {
cons_show_error("%s - %s", barejid, message); cons_show_error("%s - %s", barejid, message);
} }
@ -752,7 +752,7 @@ ui_current_print_formatted_line(const char show_char, int attrs, const char *con
va_start(arg, msg); va_start(arg, msg);
GString *fmt_msg = g_string_new(NULL); GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg); g_string_vprintf(fmt_msg, msg, arg);
win_print(current, show_char, 0, NULL, 0, attrs, "", fmt_msg->str); win_printf(current, show_char, 0, NULL, 0, attrs, "", fmt_msg->str);
va_end(arg); va_end(arg);
g_string_free(fmt_msg, TRUE); g_string_free(fmt_msg, TRUE);
} }
@ -760,14 +760,14 @@ ui_current_print_formatted_line(const char show_char, int attrs, const char *con
void void
ui_win_error_line(ProfWin *window, const char *const msg) ui_win_error_line(ProfWin *window, const char *const msg)
{ {
win_print(window, '-', 0, NULL, 0, THEME_ERROR, "", msg); win_printf(window, '-', 0, NULL, 0, THEME_ERROR, "", msg);
} }
void void
ui_current_error_line(const char *const msg) ui_current_error_line(const char *const msg)
{ {
ProfWin *current = wins_get_current(); ProfWin *current = wins_get_current();
win_print(current, '-', 0, NULL, 0, THEME_ERROR, "", msg); win_printf(current, '-', 0, NULL, 0, THEME_ERROR, "", msg);
} }
void void
@ -813,7 +813,7 @@ ui_room_join(const char *const roomjid, gboolean focus)
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", affiliation: %s", affiliation); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", affiliation: %s", affiliation);
} }
} }
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
if (focus) { if (focus) {
@ -1028,13 +1028,13 @@ ui_ask_pgp_passphrase(const char *hint, int prev_fail)
win_println(current, 0, ""); win_println(current, 0, "");
if (prev_fail) { if (prev_fail) {
win_print(current, '!', 0, NULL, 0, 0, "", "Incorrect passphrase"); win_printf(current, '!', 0, NULL, 0, 0, "", "Incorrect passphrase");
} }
if (hint) { if (hint) {
win_printf(current, '!', 0, NULL, 0, 0, "", "Enter PGP key passphrase for %s", hint); win_printf(current, '!', 0, NULL, 0, 0, "", "Enter PGP key passphrase for %s", hint);
} else { } else {
win_print(current, '!', 0, NULL, 0, 0, "", "Enter PGP key passphrase"); win_printf(current, '!', 0, NULL, 0, 0, "", "Enter PGP key passphrase");
} }
ui_update(); ui_update();
@ -1158,7 +1158,7 @@ ui_handle_room_configuration_form_error(const char *const roomjid, const char *c
g_string_append(message_str, message); g_string_append(message_str, message);
} }
win_print(window, '-', 0, NULL, 0, THEME_ERROR, "", message_str->str); win_printf(window, '-', 0, NULL, 0, THEME_ERROR, "", message_str->str);
g_string_free(message_str, TRUE); g_string_free(message_str, TRUE);
} }
@ -1182,7 +1182,7 @@ ui_handle_room_config_submit_result(const char *const roomjid)
if (muc_window) { if (muc_window) {
ui_focus_win((ProfWin*)muc_window); ui_focus_win((ProfWin*)muc_window);
win_print(muc_window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room configuration successful"); win_printf(muc_window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room configuration successful");
} else { } else {
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
ui_focus_win(console); ui_focus_win(console);
@ -1211,13 +1211,13 @@ ui_handle_room_config_submit_result_error(const char *const roomjid, const char
if (message) { if (message) {
win_printf(form_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error: %s", message); win_printf(form_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error: %s", message);
} else { } else {
win_print(form_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error"); win_printf(form_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
} }
} else if (muc_window) { } else if (muc_window) {
if (message) { if (message) {
win_printf(muc_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error: %s", message); win_printf(muc_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error: %s", message);
} else { } else {
win_print(muc_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error"); win_printf(muc_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
} }
} else { } else {
if (message) { if (message) {
@ -1227,7 +1227,7 @@ ui_handle_room_config_submit_result_error(const char *const roomjid, const char
} }
} }
} else { } else {
win_print(console, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error"); win_printf(console, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
} }
} }
@ -1237,7 +1237,7 @@ ui_show_lines(ProfWin *window, gchar** lines)
if (lines) { if (lines) {
int i; int i;
for (i = 0; lines[i] != NULL; i++) { for (i = 0; lines[i] != NULL; i++) {
win_print(window, '-', 0, NULL, 0, 0, "", lines[i]); win_printf(window, '-', 0, NULL, 0, 0, "", lines[i]);
} }
} }
} }
@ -1274,7 +1274,7 @@ ui_handle_software_version_error(const char *const roomjid, const char *const me
g_string_append(message_str, message); g_string_append(message_str, message);
} }
win_print(window, '-', 0, NULL, 0, THEME_ERROR, "", message_str->str); win_printf(window, '-', 0, NULL, 0, THEME_ERROR, "", message_str->str);
g_string_free(message_str, TRUE); g_string_free(message_str, TRUE);
} }
@ -1317,7 +1317,7 @@ ui_show_software_version(const char *const jid, const char *const presence,
win_println(window, 0, ""); win_println(window, 0, "");
theme_item_t presence_colour = theme_main_presence_attrs(presence); theme_item_t presence_colour = theme_main_presence_attrs(presence);
win_printf(window, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", jid); win_printf(window, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", jid);
win_print(window, '-', 0, NULL, NO_DATE, 0, "", ":"); win_printf(window, '-', 0, NULL, NO_DATE, 0, "", ":");
} }
if (name) { if (name) {
win_printf(window, '-', 0, NULL, 0, 0, "", "Name : %s", name); win_printf(window, '-', 0, NULL, 0, 0, "", "Name : %s", name);

View File

@ -47,12 +47,12 @@ mucconfwin_show_form(ProfMucConfWin *confwin)
{ {
ProfWin *window = (ProfWin*) confwin; ProfWin *window = (ProfWin*) confwin;
if (confwin->form->title) { if (confwin->form->title) {
win_print(window, '-', 0, NULL, NO_EOL, 0, "", "Form title: "); win_printf(window, '-', 0, NULL, NO_EOL, 0, "", "Form title: ");
win_print(window, '-', 0, NULL, NO_DATE, 0, "", confwin->form->title); win_printf(window, '-', 0, NULL, NO_DATE, 0, "", confwin->form->title);
} else { } else {
win_printf(window, '-', 0, NULL, 0, 0, "", "Configuration for room %s.", confwin->roomjid); win_printf(window, '-', 0, NULL, 0, 0, "", "Configuration for room %s.", confwin->roomjid);
} }
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
mucconfwin_form_help(confwin); mucconfwin_form_help(confwin);
@ -64,7 +64,7 @@ mucconfwin_show_form(ProfMucConfWin *confwin)
if ((g_strcmp0(field->type, "fixed") == 0) && field->values) { if ((g_strcmp0(field->type, "fixed") == 0) && field->values) {
if (field->values) { if (field->values) {
char *value = field->values->data; char *value = field->values->data;
win_print(window, '-', 0, NULL, 0, 0, "", value); win_printf(window, '-', 0, NULL, 0, 0, "", value);
} }
} else if (g_strcmp0(field->type, "hidden") != 0 && field->var) { } else if (g_strcmp0(field->type, "hidden") != 0 && field->var) {
char *tag = g_hash_table_lookup(confwin->form->var_to_tag, field->var); char *tag = g_hash_table_lookup(confwin->form->var_to_tag, field->var);
@ -96,11 +96,11 @@ mucconfwin_handle_configuration(ProfMucConfWin *confwin, DataForm *form)
mucconfwin_show_form(confwin); mucconfwin_show_form(confwin);
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
win_print(window, '-', 0, NULL, 0, 0, "", "Use '/form submit' to save changes."); win_printf(window, '-', 0, NULL, 0, 0, "", "Use '/form submit' to save changes.");
win_print(window, '-', 0, NULL, 0, 0, "", "Use '/form cancel' to cancel changes."); win_printf(window, '-', 0, NULL, 0, 0, "", "Use '/form cancel' to cancel changes.");
win_print(window, '-', 0, NULL, 0, 0, "", "See '/form help' for more information."); win_printf(window, '-', 0, NULL, 0, 0, "", "See '/form help' for more information.");
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
} }
void void
@ -111,11 +111,11 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag)
ProfWin *window = (ProfWin*) confwin; ProfWin *window = (ProfWin*) confwin;
FormField *field = form_get_field_by_tag(confwin->form, tag); FormField *field = form_get_field_by_tag(confwin->form, tag);
if (field) { if (field) {
win_print(window, '-', 0, NULL, NO_EOL, 0, "", field->label); win_printf(window, '-', 0, NULL, NO_EOL, 0, "", field->label);
if (field->required) { if (field->required) {
win_print(window, '-', 0, NULL, NO_DATE, 0, "", " (Required):"); win_printf(window, '-', 0, NULL, NO_DATE, 0, "", " (Required):");
} else { } else {
win_print(window, '-', 0, NULL, NO_DATE, 0, "", ":"); win_printf(window, '-', 0, NULL, NO_DATE, 0, "", ":");
} }
if (field->description) { if (field->description) {
win_printf(window, '-', 0, NULL, 0, 0, "", " Description : %s", field->description); win_printf(window, '-', 0, NULL, 0, 0, "", " Description : %s", field->description);
@ -130,12 +130,12 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag)
case FIELD_TEXT_SINGLE: case FIELD_TEXT_SINGLE:
case FIELD_TEXT_PRIVATE: case FIELD_TEXT_PRIVATE:
win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag); win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is any text"); win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is any text");
break; break;
case FIELD_TEXT_MULTI: case FIELD_TEXT_MULTI:
num_values = form_get_value_count(confwin->form, tag); num_values = form_get_value_count(confwin->form, tag);
win_printf(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", tag); win_printf(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is any text"); win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is any text");
if (num_values > 0) { if (num_values > 0) {
win_printf(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag); win_printf(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag);
win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> between 'val1' and 'val%d'", num_values); win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> between 'val1' and 'val%d'", num_values);
@ -143,11 +143,11 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag)
break; break;
case FIELD_BOOLEAN: case FIELD_BOOLEAN:
win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag); win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is either 'on' or 'off'"); win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is either 'on' or 'off'");
break; break;
case FIELD_LIST_SINGLE: case FIELD_LIST_SINGLE:
win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag); win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is one of"); win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is one of");
curr_option = field->options; curr_option = field->options;
while (curr_option) { while (curr_option) {
option = curr_option->data; option = curr_option->data;
@ -158,7 +158,7 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag)
case FIELD_LIST_MULTI: case FIELD_LIST_MULTI:
win_printf(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", tag); win_printf(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", tag);
win_printf(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag); win_printf(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is one of"); win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is one of");
curr_option = field->options; curr_option = field->options;
while (curr_option) { while (curr_option) {
option = curr_option->data; option = curr_option->data;
@ -168,12 +168,12 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag)
break; break;
case FIELD_JID_SINGLE: case FIELD_JID_SINGLE:
win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag); win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is a valid Jabber ID"); win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is a valid Jabber ID");
break; break;
case FIELD_JID_MULTI: case FIELD_JID_MULTI:
win_printf(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", tag); win_printf(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", tag);
win_printf(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag); win_printf(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is a valid Jabber ID"); win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is a valid Jabber ID");
break; break;
case FIELD_FIXED: case FIELD_FIXED:
case FIELD_UNKNOWN: case FIELD_UNKNOWN:
@ -193,9 +193,9 @@ mucconfwin_form_help(ProfMucConfWin *confwin)
if (confwin->form->instructions) { if (confwin->form->instructions) {
ProfWin *window = (ProfWin*) confwin; ProfWin *window = (ProfWin*) confwin;
win_print(window, '-', 0, NULL, 0, 0, "", "Supplied instructions:"); win_printf(window, '-', 0, NULL, 0, 0, "", "Supplied instructions:");
win_print(window, '-', 0, NULL, 0, 0, "", confwin->form->instructions); win_printf(window, '-', 0, NULL, 0, 0, "", confwin->form->instructions);
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
} }
} }
@ -205,9 +205,9 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
win_printf(window, '-', 0, NULL, NO_EOL, THEME_AWAY, "", "[%s] ", tag); win_printf(window, '-', 0, NULL, NO_EOL, THEME_AWAY, "", "[%s] ", tag);
win_printf(window, '-', 0, NULL, NO_EOL | NO_DATE, 0, "", "%s", field->label); win_printf(window, '-', 0, NULL, NO_EOL | NO_DATE, 0, "", "%s", field->label);
if (field->required) { if (field->required) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " (required): "); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " (required): ");
} else { } else {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ": "); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ": ");
} }
GSList *values = field->values; GSList *values = field->values;
@ -221,9 +221,9 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
char *value = curr_value->data; char *value = curr_value->data;
if (value) { if (value) {
if (g_strcmp0(field->var, "muc#roomconfig_roomsecret") == 0) { if (g_strcmp0(field->var, "muc#roomconfig_roomsecret") == 0) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", "[hidden]"); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", "[hidden]");
} else { } else {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", value); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", value);
} }
} }
} }
@ -233,7 +233,7 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
if (curr_value) { if (curr_value) {
char *value = curr_value->data; char *value = curr_value->data;
if (value) { if (value) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", "[hidden]"); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", "[hidden]");
} }
} }
win_newline(window); win_newline(window);
@ -252,16 +252,16 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
break; break;
case FIELD_BOOLEAN: case FIELD_BOOLEAN:
if (curr_value == NULL) { if (curr_value == NULL) {
win_print(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE"); win_printf(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE");
} else { } else {
char *value = curr_value->data; char *value = curr_value->data;
if (value == NULL) { if (value == NULL) {
win_print(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE"); win_printf(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE");
} else { } else {
if (g_strcmp0(value, "0") == 0) { if (g_strcmp0(value, "0") == 0) {
win_print(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE"); win_printf(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE");
} else { } else {
win_print(window, '-', 0, NULL, NO_DATE, THEME_ONLINE, "", "TRUE"); win_printf(window, '-', 0, NULL, NO_DATE, THEME_ONLINE, "", "TRUE");
} }
} }
} }
@ -303,7 +303,7 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
if (curr_value) { if (curr_value) {
char *value = curr_value->data; char *value = curr_value->data;
if (value) { if (value) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", value); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", value);
} }
} }
win_newline(window); win_newline(window);
@ -320,7 +320,7 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
if (curr_value) { if (curr_value) {
char *value = curr_value->data; char *value = curr_value->data;
if (value) { if (value) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", value); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", value);
} }
} }
win_newline(window); win_newline(window);

View File

@ -58,7 +58,7 @@ mucwin_role_change(ProfMucWin *mucwin, const char *const role, const char *const
if (reason) { if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
void void
@ -75,7 +75,7 @@ mucwin_affiliation_change(ProfMucWin *mucwin, const char *const affiliation, con
if (reason) { if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
void void
@ -92,7 +92,7 @@ mucwin_role_and_affiliation_change(ProfMucWin *mucwin, const char *const role, c
if (reason) { if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
@ -110,7 +110,7 @@ mucwin_occupant_role_change(ProfMucWin *mucwin, const char *const nick, const ch
if (reason) { if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
void void
@ -127,7 +127,7 @@ mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char *const nick, c
if (reason) { if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
void void
@ -144,7 +144,7 @@ mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char *cons
if (reason) { if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
void void
@ -154,7 +154,7 @@ mucwin_room_info_error(ProfMucWin *mucwin, const char *const error)
ProfWin *window = (ProfWin*)mucwin; ProfWin *window = (ProfWin*)mucwin;
win_printf(window, '!', 0, NULL, 0, 0, "", "Room info request failed: %s", error); win_printf(window, '!', 0, NULL, 0, 0, "", "Room info request failed: %s", error);
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
} }
void void
@ -166,7 +166,7 @@ mucwin_room_disco_info(ProfMucWin *mucwin, GSList *identities, GSList *features)
if ((identities && (g_slist_length(identities) > 0)) || if ((identities && (g_slist_length(identities) > 0)) ||
(features && (g_slist_length(features) > 0))) { (features && (g_slist_length(features) > 0))) {
if (identities) { if (identities) {
win_print(window, '!', 0, NULL, 0, 0, "", "Identities:"); win_printf(window, '!', 0, NULL, 0, 0, "", "Identities:");
} }
while (identities) { while (identities) {
DiscoIdentity *identity = identities->data; // anme trpe, cat DiscoIdentity *identity = identities->data; // anme trpe, cat
@ -182,19 +182,19 @@ mucwin_room_disco_info(ProfMucWin *mucwin, GSList *identities, GSList *features)
if (identity->category) { if (identity->category) {
identity_str = g_string_append(identity_str, identity->category); identity_str = g_string_append(identity_str, identity->category);
} }
win_print(window, '!', 0, NULL, 0, 0, "", identity_str->str); win_printf(window, '!', 0, NULL, 0, 0, "", identity_str->str);
g_string_free(identity_str, TRUE); g_string_free(identity_str, TRUE);
identities = g_slist_next(identities); identities = g_slist_next(identities);
} }
if (features) { if (features) {
win_print(window, '!', 0, NULL, 0, 0, "", "Features:"); win_printf(window, '!', 0, NULL, 0, 0, "", "Features:");
} }
while (features) { while (features) {
win_printf(window, '!', 0, NULL, 0, 0, "", " %s", features->data); win_printf(window, '!', 0, NULL, 0, 0, "", " %s", features->data);
features = g_slist_next(features); features = g_slist_next(features);
} }
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
} }
} }
@ -206,7 +206,7 @@ mucwin_roster(ProfMucWin *mucwin, GList *roster, const char *const presence)
ProfWin *window = (ProfWin*)mucwin; ProfWin *window = (ProfWin*)mucwin;
if ((roster == NULL) || (g_list_length(roster) == 0)) { if ((roster == NULL) || (g_list_length(roster) == 0)) {
if (presence == NULL) { if (presence == NULL) {
win_print(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room is empty."); win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room is empty.");
} else { } else {
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "No occupants %s.", presence); win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "No occupants %s.", presence);
} }
@ -226,12 +226,12 @@ mucwin_roster(ProfMucWin *mucwin, GList *roster, const char *const presence)
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", occupant->nick); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", occupant->nick);
if (roster->next) { if (roster->next) {
win_print(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", ", "); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", ", ");
} }
roster = g_list_next(roster); roster = g_list_next(roster);
} }
win_print(window, '!', 0, NULL, NO_DATE, THEME_ONLINE, "", ""); win_printf(window, '!', 0, NULL, NO_DATE, THEME_ONLINE, "", "");
} }
} }
@ -305,7 +305,7 @@ mucwin_occupant_online(ProfMucWin *mucwin, const char *const nick, const char *c
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", ", affiliation: %s", affiliation); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", ", affiliation: %s", affiliation);
} }
} }
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
void void
@ -355,7 +355,7 @@ mucwin_history(ProfMucWin *mucwin, const char *const nick, GDateTime *timestamp,
g_string_append(line, message); g_string_append(line, message);
} }
win_print(window, '-', 0, timestamp, NO_COLOUR_DATE, 0, "", line->str); win_printf(window, '-', 0, timestamp, NO_COLOUR_DATE, 0, "", line->str);
g_string_free(line, TRUE); g_string_free(line, TRUE);
plugins_on_room_history_message(mucwin->roomjid, nick, message, timestamp); plugins_on_room_history_message(mucwin->roomjid, nick, message, timestamp);
@ -371,10 +371,10 @@ _mucwin_print_mention(ProfWin *window, const char *const message, const char *co
pos = GPOINTER_TO_INT(curr->data); pos = GPOINTER_TO_INT(curr->data);
char *before_str = g_strndup(message + last_pos, pos - last_pos); char *before_str = g_strndup(message + last_pos, pos - last_pos);
win_print(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMMENTION, "", before_str); win_printf(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMMENTION, "", before_str);
g_free(before_str); g_free(before_str);
char *nick_str = g_strndup(message + pos, strlen(nick)); char *nick_str = g_strndup(message + pos, strlen(nick));
win_print(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMMENTION_TERM, "", nick_str); win_printf(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMMENTION_TERM, "", nick_str);
g_free(nick_str); g_free(nick_str);
last_pos = pos + strlen(nick); last_pos = pos + strlen(nick);
@ -382,9 +382,9 @@ _mucwin_print_mention(ProfWin *window, const char *const message, const char *co
curr = g_slist_next(curr); curr = g_slist_next(curr);
} }
if (last_pos < strlen(message)) { if (last_pos < strlen(message)) {
win_print(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMMENTION, "", &message[last_pos]); win_printf(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMMENTION, "", &message[last_pos]);
} else { } else {
win_print(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMMENTION, "", ""); win_printf(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMMENTION, "", "");
} }
} }
@ -442,7 +442,7 @@ _mucwin_print_triggers(ProfWin *window, const char *const message, GList *trigge
// no triggers found // no triggers found
if (first_trigger_pos == -1) { if (first_trigger_pos == -1) {
win_print(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMTRIGGER, "", message); win_printf(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMTRIGGER, "", message);
} else { } else {
if (first_trigger_pos > 0) { if (first_trigger_pos > 0) {
char message_section[strlen(message) + 1]; char message_section[strlen(message) + 1];
@ -452,7 +452,7 @@ _mucwin_print_triggers(ProfWin *window, const char *const message, GList *trigge
i++; i++;
} }
message_section[i] = '\0'; message_section[i] = '\0';
win_print(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMTRIGGER, "", message_section); win_printf(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMTRIGGER, "", message_section);
} }
char trigger_section[first_trigger_len + 1]; char trigger_section[first_trigger_len + 1];
int i = 0; int i = 0;
@ -463,10 +463,10 @@ _mucwin_print_triggers(ProfWin *window, const char *const message, GList *trigge
trigger_section[i] = '\0'; trigger_section[i] = '\0';
if (first_trigger_pos + first_trigger_len < strlen(message)) { if (first_trigger_pos + first_trigger_len < strlen(message)) {
win_print(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMTRIGGER_TERM, "", trigger_section); win_printf(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMTRIGGER_TERM, "", trigger_section);
_mucwin_print_triggers(window, &message[first_trigger_pos + first_trigger_len], triggers); _mucwin_print_triggers(window, &message[first_trigger_pos + first_trigger_len], triggers);
} else { } else {
win_print(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMTRIGGER_TERM, "", trigger_section); win_printf(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMTRIGGER_TERM, "", trigger_section);
} }
} }
} }
@ -481,16 +481,16 @@ mucwin_message(ProfMucWin *mucwin, const char *const nick, const char *const mes
if (g_strcmp0(nick, mynick) != 0) { if (g_strcmp0(nick, mynick) != 0) {
if (g_slist_length(mentions) > 0) { if (g_slist_length(mentions) > 0) {
win_print(window, '-', 0, NULL, NO_ME | NO_EOL, THEME_ROOMMENTION, nick, ""); win_printf(window, '-', 0, NULL, NO_ME | NO_EOL, THEME_ROOMMENTION, nick, "");
_mucwin_print_mention(window, message, mynick, mentions); _mucwin_print_mention(window, message, mynick, mentions);
} else if (triggers) { } else if (triggers) {
win_print(window, '-', 0, NULL, NO_ME | NO_EOL, THEME_ROOMTRIGGER, nick, ""); win_printf(window, '-', 0, NULL, NO_ME | NO_EOL, THEME_ROOMTRIGGER, nick, "");
_mucwin_print_triggers(window, message, triggers); _mucwin_print_triggers(window, message, triggers);
} else { } else {
win_print(window, '-', 0, NULL, NO_ME, THEME_TEXT_THEM, nick, message); win_printf(window, '-', 0, NULL, NO_ME, THEME_TEXT_THEM, nick, message);
} }
} else { } else {
win_print(window, '-', 0, NULL, 0, THEME_TEXT_ME, nick, message); win_printf(window, '-', 0, NULL, 0, THEME_TEXT_ME, nick, message);
} }
} }
@ -506,12 +506,12 @@ mucwin_requires_config(ProfMucWin *mucwin)
ui_index = 0; ui_index = 0;
} }
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room locked, requires configuration."); win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room locked, requires configuration.");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room accept' to accept the defaults"); win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room accept' to accept the defaults");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room destroy' to cancel and destroy the room"); win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room destroy' to cancel and destroy the room");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room config' to edit the room configuration"); win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room config' to edit the room configuration");
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
// currently in groupchat window // currently in groupchat window
if (wins_is_current(window)) { if (wins_is_current(window)) {
@ -611,10 +611,10 @@ mucwin_handle_affiliation_list(ProfMucWin *mucwin, const char *const affiliation
win_printf(window, '!', 0, NULL, 0, 0, "", " %s", jid); win_printf(window, '!', 0, NULL, 0, 0, "", " %s", jid);
curr_jid = g_slist_next(curr_jid); curr_jid = g_slist_next(curr_jid);
} }
win_print(window, '!', 0, NULL, 0, 0, "", ""); win_printf(window, '!', 0, NULL, 0, 0, "", "");
} else { } else {
win_printf(window, '!', 0, NULL, 0, 0, "", "No users found with affiliation: %s", affiliation); win_printf(window, '!', 0, NULL, 0, 0, "", "No users found with affiliation: %s", affiliation);
win_print(window, '!', 0, NULL, 0, 0, "", ""); win_printf(window, '!', 0, NULL, 0, 0, "", "");
} }
} }
@ -629,34 +629,34 @@ mucwin_show_affiliation_list(ProfMucWin *mucwin, muc_affiliation_t affiliation)
if (!occupants) { if (!occupants) {
switch (affiliation) { switch (affiliation) {
case MUC_AFFILIATION_OWNER: case MUC_AFFILIATION_OWNER:
win_print(window, '!', 0, NULL, 0, 0, "", "No owners found."); win_printf(window, '!', 0, NULL, 0, 0, "", "No owners found.");
break; break;
case MUC_AFFILIATION_ADMIN: case MUC_AFFILIATION_ADMIN:
win_print(window, '!', 0, NULL, 0, 0, "", "No admins found."); win_printf(window, '!', 0, NULL, 0, 0, "", "No admins found.");
break; break;
case MUC_AFFILIATION_MEMBER: case MUC_AFFILIATION_MEMBER:
win_print(window, '!', 0, NULL, 0, 0, "", "No members found."); win_printf(window, '!', 0, NULL, 0, 0, "", "No members found.");
break; break;
case MUC_AFFILIATION_OUTCAST: case MUC_AFFILIATION_OUTCAST:
win_print(window, '!', 0, NULL, 0, 0, "", "No outcasts found."); win_printf(window, '!', 0, NULL, 0, 0, "", "No outcasts found.");
break; break;
default: default:
break; break;
} }
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
} else { } else {
switch (affiliation) { switch (affiliation) {
case MUC_AFFILIATION_OWNER: case MUC_AFFILIATION_OWNER:
win_print(window, '!', 0, NULL, 0, 0, "", "Owners:"); win_printf(window, '!', 0, NULL, 0, 0, "", "Owners:");
break; break;
case MUC_AFFILIATION_ADMIN: case MUC_AFFILIATION_ADMIN:
win_print(window, '!', 0, NULL, 0, 0, "", "Admins:"); win_printf(window, '!', 0, NULL, 0, 0, "", "Admins:");
break; break;
case MUC_AFFILIATION_MEMBER: case MUC_AFFILIATION_MEMBER:
win_print(window, '!', 0, NULL, 0, 0, "", "Members:"); win_printf(window, '!', 0, NULL, 0, 0, "", "Members:");
break; break;
case MUC_AFFILIATION_OUTCAST: case MUC_AFFILIATION_OUTCAST:
win_print(window, '!', 0, NULL, 0, 0, "", "Outcasts:"); win_printf(window, '!', 0, NULL, 0, 0, "", "Outcasts:");
break; break;
default: default:
break; break;
@ -676,7 +676,7 @@ mucwin_show_affiliation_list(ProfMucWin *mucwin, muc_affiliation_t affiliation)
curr_occupant = g_slist_next(curr_occupant); curr_occupant = g_slist_next(curr_occupant);
} }
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
} }
} }
@ -712,10 +712,10 @@ mucwin_handle_role_list(ProfMucWin *mucwin, const char *const role, GSList *nick
} }
curr_nick = g_slist_next(curr_nick); curr_nick = g_slist_next(curr_nick);
} }
win_print(window, '!', 0, NULL, 0, 0, "", ""); win_printf(window, '!', 0, NULL, 0, 0, "", "");
} else { } else {
win_printf(window, '!', 0, NULL, 0, 0, "", "No occupants found with role: %s", role); win_printf(window, '!', 0, NULL, 0, 0, "", "No occupants found with role: %s", role);
win_print(window, '!', 0, NULL, 0, 0, "", ""); win_printf(window, '!', 0, NULL, 0, 0, "", "");
} }
} }
@ -730,28 +730,28 @@ mucwin_show_role_list(ProfMucWin *mucwin, muc_role_t role)
if (!occupants) { if (!occupants) {
switch (role) { switch (role) {
case MUC_ROLE_MODERATOR: case MUC_ROLE_MODERATOR:
win_print(window, '!', 0, NULL, 0, 0, "", "No moderators found."); win_printf(window, '!', 0, NULL, 0, 0, "", "No moderators found.");
break; break;
case MUC_ROLE_PARTICIPANT: case MUC_ROLE_PARTICIPANT:
win_print(window, '!', 0, NULL, 0, 0, "", "No participants found."); win_printf(window, '!', 0, NULL, 0, 0, "", "No participants found.");
break; break;
case MUC_ROLE_VISITOR: case MUC_ROLE_VISITOR:
win_print(window, '!', 0, NULL, 0, 0, "", "No visitors found."); win_printf(window, '!', 0, NULL, 0, 0, "", "No visitors found.");
break; break;
default: default:
break; break;
} }
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
} else { } else {
switch (role) { switch (role) {
case MUC_ROLE_MODERATOR: case MUC_ROLE_MODERATOR:
win_print(window, '!', 0, NULL, 0, 0, "", "Moderators:"); win_printf(window, '!', 0, NULL, 0, 0, "", "Moderators:");
break; break;
case MUC_ROLE_PARTICIPANT: case MUC_ROLE_PARTICIPANT:
win_print(window, '!', 0, NULL, 0, 0, "", "Participants:"); win_printf(window, '!', 0, NULL, 0, 0, "", "Participants:");
break; break;
case MUC_ROLE_VISITOR: case MUC_ROLE_VISITOR:
win_print(window, '!', 0, NULL, 0, 0, "", "Visitors:"); win_printf(window, '!', 0, NULL, 0, 0, "", "Visitors:");
break; break;
default: default:
break; break;
@ -771,7 +771,7 @@ mucwin_show_role_list(ProfMucWin *mucwin, muc_role_t role)
curr_occupant = g_slist_next(curr_occupant); curr_occupant = g_slist_next(curr_occupant);
} }
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
} }
} }
@ -807,7 +807,7 @@ mucwin_info(ProfMucWin *mucwin)
win_printf(window, '!', 0, NULL, 0, 0, "", "Room: %s", mucwin->roomjid); win_printf(window, '!', 0, NULL, 0, 0, "", "Room: %s", mucwin->roomjid);
win_printf(window, '!', 0, NULL, 0, 0, "", "Affiliation: %s", affiliation); win_printf(window, '!', 0, NULL, 0, 0, "", "Affiliation: %s", affiliation);
win_printf(window, '!', 0, NULL, 0, 0, "", "Role: %s", role); win_printf(window, '!', 0, NULL, 0, 0, "", "Role: %s", role);
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
} }
void void

View File

@ -93,7 +93,7 @@ privwin_outgoing_msg(ProfPrivateWin *privwin, const char *const message)
{ {
assert(privwin != NULL); assert(privwin != NULL);
win_print((ProfWin*)privwin, '-', 0, NULL, 0, THEME_TEXT_ME, "me", message); win_printf((ProfWin*)privwin, '-', 0, NULL, 0, THEME_TEXT_ME, "me", message);
} }
void void
@ -101,7 +101,7 @@ privwin_message_occupant_offline(ProfPrivateWin *privwin)
{ {
assert(privwin != NULL); assert(privwin != NULL);
win_print((ProfWin*)privwin, '-', 0, NULL, 0, THEME_ERROR, NULL, "Unable to send message, occupant no longer present in room."); win_printf((ProfWin*)privwin, '-', 0, NULL, 0, THEME_ERROR, NULL, "Unable to send message, occupant no longer present in room.");
} }
void void
@ -109,7 +109,7 @@ privwin_message_left_room(ProfPrivateWin *privwin)
{ {
assert(privwin != NULL); assert(privwin != NULL);
win_print((ProfWin*)privwin, '-', 0, NULL, 0, THEME_ERROR, NULL, "Unable to send message, you are no longer present in room."); win_printf((ProfWin*)privwin, '-', 0, NULL, 0, THEME_ERROR, NULL, "Unable to send message, you are no longer present in room.");
} }
void void

View File

@ -357,8 +357,8 @@ void win_hide_subwin(ProfWin *window);
void win_show_subwin(ProfWin *window); void win_show_subwin(ProfWin *window);
void win_refresh_without_subwin(ProfWin *window); void win_refresh_without_subwin(ProfWin *window);
void win_refresh_with_subwin(ProfWin *window); void win_refresh_with_subwin(ProfWin *window);
void win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, int flags, theme_item_t theme_item, const char *const from, const char *const message); void win_printf(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, int flags,
void win_printf(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, int flags, theme_item_t theme_item, const char *const from, const char *const message, ...); theme_item_t theme_item, const char *const from, const char *const message, ...);
char* win_get_title(ProfWin *window); char* win_get_title(ProfWin *window);
void win_show_occupant(ProfWin *window, Occupant *occupant); void win_show_occupant(ProfWin *window, Occupant *occupant);
void win_show_occupant_info(ProfWin *window, const char *const room, Occupant *occupant); void win_show_occupant_info(ProfWin *window, const char *const room, Occupant *occupant);

View File

@ -683,14 +683,14 @@ win_show_occupant(ProfWin *window, Occupant *occupant)
theme_item_t presence_colour = theme_main_presence_attrs(presence_str); theme_item_t presence_colour = theme_main_presence_attrs(presence_str);
win_print(window, '-', 0, NULL, NO_EOL, presence_colour, "", occupant->nick); win_printf(window, '-', 0, NULL, NO_EOL, presence_colour, "", occupant->nick);
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str);
if (occupant->status) { if (occupant->status) {
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", occupant->status); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", occupant->status);
} }
win_print(window, '-', 0, NULL, NO_DATE, presence_colour, "", ""); win_printf(window, '-', 0, NULL, NO_DATE, presence_colour, "", "");
} }
void void
@ -705,9 +705,9 @@ win_show_contact(ProfWin *window, PContact contact)
theme_item_t presence_colour = theme_main_presence_attrs(presence); theme_item_t presence_colour = theme_main_presence_attrs(presence);
if (name) { if (name) {
win_print(window, '-', 0, NULL, NO_EOL, presence_colour, "", name); win_printf(window, '-', 0, NULL, NO_EOL, presence_colour, "", name);
} else { } else {
win_print(window, '-', 0, NULL, NO_EOL, presence_colour, "", barejid); win_printf(window, '-', 0, NULL, NO_EOL, presence_colour, "", barejid);
} }
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence);
@ -735,7 +735,7 @@ win_show_contact(ProfWin *window, PContact contact)
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", p_contact_status(contact)); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", p_contact_status(contact));
} }
win_print(window, '-', 0, NULL, NO_DATE, presence_colour, "", ""); win_printf(window, '-', 0, NULL, NO_DATE, presence_colour, "", "");
} }
void void
@ -747,7 +747,7 @@ win_show_occupant_info(ProfWin *window, const char *const room, Occupant *occupa
theme_item_t presence_colour = theme_main_presence_attrs(presence_str); theme_item_t presence_colour = theme_main_presence_attrs(presence_str);
win_print(window, '!', 0, NULL, NO_EOL, presence_colour, "", occupant->nick); win_printf(window, '!', 0, NULL, NO_EOL, presence_colour, "", occupant->nick);
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str);
if (occupant->status) { if (occupant->status) {
@ -771,21 +771,21 @@ win_show_occupant_info(ProfWin *window, const char *const room, Occupant *occupa
// show identity // show identity
if (caps->identity) { if (caps->identity) {
DiscoIdentity *identity = caps->identity; DiscoIdentity *identity = caps->identity;
win_print(window, '!', 0, NULL, NO_EOL, 0, "", " Identity: "); win_printf(window, '!', 0, NULL, NO_EOL, 0, "", " Identity: ");
if (identity->name) { if (identity->name) {
win_print(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name);
if (identity->category || identity->type) { if (identity->category || identity->type) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " "); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
} }
} }
if (identity->type) { if (identity->type) {
win_print(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type);
if (identity->category) { if (identity->category) {
win_print(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", " "); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
} }
} }
if (identity->category) { if (identity->category) {
win_print(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category); win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category);
} }
win_newline(window); win_newline(window);
} }
@ -815,7 +815,7 @@ win_show_occupant_info(ProfWin *window, const char *const room, Occupant *occupa
caps_destroy(caps); caps_destroy(caps);
} }
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
} }
void void
@ -829,12 +829,12 @@ win_show_info(ProfWin *window, PContact contact)
theme_item_t presence_colour = theme_main_presence_attrs(presence); theme_item_t presence_colour = theme_main_presence_attrs(presence);
win_print(window, '-', 0, NULL, 0, 0, "", ""); win_printf(window, '-', 0, NULL, 0, 0, "", "");
win_print(window, '-', 0, NULL, NO_EOL, presence_colour, "", barejid); win_printf(window, '-', 0, NULL, NO_EOL, presence_colour, "", barejid);
if (name) { if (name) {
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (%s)", name); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (%s)", name);
} }
win_print(window, '-', 0, NULL, NO_DATE, 0, "", ":"); win_printf(window, '-', 0, NULL, NO_DATE, 0, "", ":");
if (sub) { if (sub) {
win_printf(window, '-', 0, NULL, 0, 0, "", "Subscription: %s", sub); win_printf(window, '-', 0, NULL, 0, 0, "", "Subscription: %s", sub);
@ -863,7 +863,7 @@ win_show_info(ProfWin *window, PContact contact)
GList *resources = p_contact_get_available_resources(contact); GList *resources = p_contact_get_available_resources(contact);
GList *ordered_resources = NULL; GList *ordered_resources = NULL;
if (resources) { if (resources) {
win_print(window, '-', 0, NULL, 0, 0, "", "Resources:"); win_printf(window, '-', 0, NULL, 0, 0, "", "Resources:");
// sort in order of availability // sort in order of availability
GList *curr = resources; GList *curr = resources;
@ -895,21 +895,21 @@ win_show_info(ProfWin *window, PContact contact)
// show identity // show identity
if (caps->identity) { if (caps->identity) {
DiscoIdentity *identity = caps->identity; DiscoIdentity *identity = caps->identity;
win_print(window, '-', 0, NULL, NO_EOL, 0, "", " Identity: "); win_printf(window, '-', 0, NULL, NO_EOL, 0, "", " Identity: ");
if (identity->name) { if (identity->name) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name);
if (identity->category || identity->type) { if (identity->category || identity->type) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " "); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
} }
} }
if (identity->type) { if (identity->type) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type);
if (identity->category) { if (identity->category) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " "); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
} }
} }
if (identity->category) { if (identity->category) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category);
} }
win_newline(window); win_newline(window);
} }
@ -983,7 +983,7 @@ win_show_status_string(ProfWin *window, const char *const from,
if (status) if (status)
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", status); win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", status);
win_print(window, '-', 0, NULL, NO_DATE, presence_colour, "", ""); win_printf(window, '-', 0, NULL, NO_DATE, presence_colour, "", "");
} }
@ -1001,10 +1001,10 @@ win_print_incoming_message(ProfWin *window, GDateTime *timestamp,
} else if (enc_mode == PROF_MSG_PGP) { } else if (enc_mode == PROF_MSG_PGP) {
enc_char = prefs_get_pgp_char(); enc_char = prefs_get_pgp_char();
} }
win_print(window, enc_char, 0, timestamp, NO_ME, THEME_TEXT_THEM, from, message); win_printf(window, enc_char, 0, timestamp, NO_ME, THEME_TEXT_THEM, from, message);
break; break;
case WIN_PRIVATE: case WIN_PRIVATE:
win_print(window, '-', 0, timestamp, NO_ME, THEME_TEXT_THEM, from, message); win_printf(window, '-', 0, timestamp, NO_ME, THEME_TEXT_THEM, from, message);
break; break;
default: default:
assert(FALSE); assert(FALSE);
@ -1015,19 +1015,6 @@ win_print_incoming_message(ProfWin *window, GDateTime *timestamp,
void void
win_printf(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, win_printf(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp,
int flags, theme_item_t theme_item, const char *const from, const char *const message, ...) int flags, theme_item_t theme_item, const char *const from, const char *const message, ...)
{
va_list arg;
va_start(arg, message);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, message, arg);
win_print(window, show_char, pad_indent, timestamp, flags, theme_item, from, fmt_msg->str);
g_string_free(fmt_msg, TRUE);
va_end(arg);
}
void
win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp,
int flags, theme_item_t theme_item, const char *const from, const char *const message)
{ {
if (timestamp == NULL) { if (timestamp == NULL) {
timestamp = g_date_time_new_now_local(); timestamp = g_date_time_new_now_local();
@ -1035,11 +1022,20 @@ win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *time
g_date_time_ref(timestamp); g_date_time_ref(timestamp);
} }
buffer_push(window->layout->buffer, show_char, pad_indent, timestamp, flags, theme_item, from, message, NULL); va_list arg;
_win_print(window, show_char, pad_indent, timestamp, flags, theme_item, from, message, NULL); va_start(arg, message);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, message, arg);
buffer_push(window->layout->buffer, show_char, pad_indent, timestamp, flags, theme_item, from, fmt_msg->str, NULL);
_win_print(window, show_char, pad_indent, timestamp, flags, theme_item, from, fmt_msg->str, NULL);
// TODO: cross-reference.. this should be replaced by a real event-based system // TODO: cross-reference.. this should be replaced by a real event-based system
inp_nonblocking(TRUE); inp_nonblocking(TRUE);
g_date_time_unref(timestamp); g_date_time_unref(timestamp);
g_string_free(fmt_msg, TRUE);
va_end(arg);
} }
void void
@ -1098,7 +1094,7 @@ win_update_entry_theme(ProfWin *window, const char *const id, theme_item_t theme
void void
win_println(ProfWin *window, int pad, const char *const message) win_println(ProfWin *window, int pad, const char *const message)
{ {
win_print(window, '-', pad, NULL, 0, 0, "", message); win_printf(window, '-', pad, NULL, 0, 0, "", message);
} }
void void
@ -1108,7 +1104,7 @@ win_vprintln_ch(ProfWin *window, char ch, const char *const message, ...)
va_start(arg, message); va_start(arg, message);
GString *fmt_msg = g_string_new(NULL); GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, message, arg); g_string_vprintf(fmt_msg, message, arg);
win_print(window, ch, 0, NULL, 0, 0, "", fmt_msg->str); win_printf(window, ch, 0, NULL, 0, 0, "", fmt_msg->str);
g_string_free(fmt_msg, TRUE); g_string_free(fmt_msg, TRUE);
va_end(arg); va_end(arg);
} }
@ -1116,7 +1112,7 @@ win_vprintln_ch(ProfWin *window, char ch, const char *const message, ...)
void void
win_newline(ProfWin *window) win_newline(ProfWin *window)
{ {
win_print(window, '-', 0, NULL, NO_DATE, 0, "", ""); win_printf(window, '-', 0, NULL, NO_DATE, 0, "", "");
} }
static void static void

View File

@ -835,7 +835,7 @@ wins_lost_connection(void)
while (curr) { while (curr) {
ProfWin *window = curr->data; ProfWin *window = curr->data;
if (window->type != WIN_CONSOLE) { if (window->type != WIN_CONSOLE) {
win_print(window, '-', 0, NULL, 0, THEME_ERROR, "", "Lost connection."); win_printf(window, '-', 0, NULL, 0, THEME_ERROR, "", "Lost connection.");
// if current win, set current_win_dirty // if current win, set current_win_dirty
if (wins_is_current(window)) { if (wins_is_current(window)) {

View File

@ -45,13 +45,13 @@ xmlwin_show(ProfXMLWin *xmlwin, const char *const msg)
ProfWin *window = (ProfWin*)xmlwin; ProfWin *window = (ProfWin*)xmlwin;
if (g_str_has_prefix(msg, "SENT:")) { if (g_str_has_prefix(msg, "SENT:")) {
win_print(window, '-', 0, NULL, 0, 0, "", "SENT:"); win_printf(window, '-', 0, NULL, 0, 0, "", "SENT:");
win_print(window, '-', 0, NULL, 0, THEME_ONLINE, "", &msg[6]); win_printf(window, '-', 0, NULL, 0, THEME_ONLINE, "", &msg[6]);
win_print(window, '-', 0, NULL, 0, THEME_ONLINE, "", ""); win_printf(window, '-', 0, NULL, 0, THEME_ONLINE, "", "");
} else if (g_str_has_prefix(msg, "RECV:")) { } else if (g_str_has_prefix(msg, "RECV:")) {
win_print(window, '-', 0, NULL, 0, 0, "", "RECV:"); win_printf(window, '-', 0, NULL, 0, 0, "", "RECV:");
win_print(window, '-', 0, NULL, 0, THEME_AWAY, "", &msg[6]); win_printf(window, '-', 0, NULL, 0, THEME_AWAY, "", &msg[6]);
win_print(window, '-', 0, NULL, 0, THEME_AWAY, "", ""); win_printf(window, '-', 0, NULL, 0, THEME_AWAY, "", "");
} }
} }

View File

@ -520,7 +520,6 @@ void win_hide_subwin(ProfWin *window) {}
void win_show_subwin(ProfWin *window) {} void win_show_subwin(ProfWin *window) {}
void win_refresh_without_subwin(ProfWin *window) {} void win_refresh_without_subwin(ProfWin *window) {}
void win_refresh_with_subwin(ProfWin *window) {} void win_refresh_with_subwin(ProfWin *window) {}
void win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, int flags, theme_item_t theme_item, const char * const from, const char * const message) {}
void win_printf(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, int flags, theme_item_t theme_item, const char * const from, const char * const message, ...) {} void win_printf(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, int flags, theme_item_t theme_item, const char * const from, const char * const message, ...) {}
char* win_get_title(ProfWin *window) char* win_get_title(ProfWin *window)
{ {