From 0763bfc9f49dd445502d518b530654720d2d9985 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 22 Nov 2015 01:00:14 +0000 Subject: [PATCH] Pass wrap boolean to win_sub_print() --- src/ui/occupantswin.c | 12 ++++++------ src/ui/rosterwin.c | 20 ++++++++++---------- src/ui/window.c | 2 +- src/ui/window.h | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/ui/occupantswin.c b/src/ui/occupantswin.c index 3c1d9dd5..7e22ab0b 100644 --- a/src/ui/occupantswin.c +++ b/src/ui/occupantswin.c @@ -48,13 +48,13 @@ _occuptantswin_occupant(ProfLayoutSplit *layout, Occupant *occupant, gboolean sh GString *msg = g_string_new(" "); g_string_append(msg, occupant->nick); - win_sub_print_nowrap(layout->subwin, msg->str, TRUE); + win_sub_print(layout->subwin, msg->str, TRUE, FALSE); g_string_free(msg, TRUE); if (showjid && occupant->jid) { GString *msg = g_string_new(" "); g_string_append(msg, occupant->jid); - win_sub_print_nowrap(layout->subwin, msg->str, TRUE); + win_sub_print(layout->subwin, msg->str, TRUE, FALSE); g_string_free(msg, TRUE); } @@ -75,7 +75,7 @@ occupantswin_occupants(const char *const roomjid) if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) { wattron(layout->subwin, theme_attrs(THEME_OCCUPANTS_HEADER)); - win_sub_print_nowrap(layout->subwin, " -Moderators", TRUE); + win_sub_print(layout->subwin, " -Moderators", TRUE, FALSE); wattroff(layout->subwin, theme_attrs(THEME_OCCUPANTS_HEADER)); GList *roster_curr = occupants; while (roster_curr) { @@ -87,7 +87,7 @@ occupantswin_occupants(const char *const roomjid) } wattron(layout->subwin, theme_attrs(THEME_OCCUPANTS_HEADER)); - win_sub_print_nowrap(layout->subwin, " -Participants", TRUE); + win_sub_print(layout->subwin, " -Participants", TRUE, FALSE); wattroff(layout->subwin, theme_attrs(THEME_OCCUPANTS_HEADER)); roster_curr = occupants; while (roster_curr) { @@ -99,7 +99,7 @@ occupantswin_occupants(const char *const roomjid) } wattron(layout->subwin, theme_attrs(THEME_OCCUPANTS_HEADER)); - win_sub_print_nowrap(layout->subwin, " -Visitors", TRUE); + win_sub_print(layout->subwin, " -Visitors", TRUE, FALSE); wattroff(layout->subwin, theme_attrs(THEME_OCCUPANTS_HEADER)); roster_curr = occupants; while (roster_curr) { @@ -111,7 +111,7 @@ occupantswin_occupants(const char *const roomjid) } } else { wattron(layout->subwin, theme_attrs(THEME_OCCUPANTS_HEADER)); - win_sub_print_nowrap(layout->subwin, " -Occupants\n", TRUE); + win_sub_print(layout->subwin, " -Occupants\n", TRUE, FALSE); wattroff(layout->subwin, theme_attrs(THEME_OCCUPANTS_HEADER)); GList *roster_curr = occupants; while (roster_curr) { diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c index 79293fc6..4df9516b 100644 --- a/src/ui/rosterwin.c +++ b/src/ui/rosterwin.c @@ -68,7 +68,7 @@ _rosterwin_presence(ProfLayoutSplit *layout, theme_item_t colour, const char *pr if (presence_indent == -1) { GString *msg = g_string_new(""); g_string_append_printf(msg, ": \"%s\"", status); - win_sub_print_nowrap(layout->subwin, msg->str, FALSE); + win_sub_print(layout->subwin, msg->str, FALSE, FALSE); g_string_free(msg, TRUE); wattroff(layout->subwin, theme_attrs(colour)); } else { @@ -79,7 +79,7 @@ _rosterwin_presence(ProfLayoutSplit *layout, theme_item_t colour, const char *pr } g_string_append_printf(msg, "\"%s\"", status); win_sub_newline_lazy(layout->subwin); - win_sub_print_nowrap(layout->subwin, msg->str, FALSE); + win_sub_print(layout->subwin, msg->str, FALSE, FALSE); g_string_free(msg, TRUE); wattroff(layout->subwin, theme_attrs(colour)); } @@ -98,7 +98,7 @@ _rosterwin_presence(ProfLayoutSplit *layout, theme_item_t colour, const char *pr } else if (status && prefs_get_boolean(PREF_ROSTER_STATUS)) { g_string_append_printf(msg, ": \"%s\"", status); } - win_sub_print_nowrap(layout->subwin, msg->str, FALSE); + win_sub_print(layout->subwin, msg->str, FALSE, FALSE); g_string_free(msg, TRUE); wattroff(layout->subwin, theme_attrs(colour)); } else { @@ -116,7 +116,7 @@ _rosterwin_presence(ProfLayoutSplit *layout, theme_item_t colour, const char *pr g_string_append_printf(msg, "\"%s\"", status); } win_sub_newline_lazy(layout->subwin); - win_sub_print_nowrap(layout->subwin, msg->str, FALSE); + win_sub_print(layout->subwin, msg->str, FALSE, FALSE); g_string_free(msg, TRUE); wattroff(layout->subwin, theme_attrs(colour)); } @@ -151,7 +151,7 @@ _rosterwin_resources(ProfLayoutSplit *layout, PContact contact, int current_inde g_string_append_printf(msg, " %d", resource->priority); } win_sub_newline_lazy(layout->subwin); - win_sub_print_nowrap(layout->subwin, msg->str, FALSE); + win_sub_print(layout->subwin, msg->str, FALSE, FALSE); g_string_free(msg, TRUE); wattroff(layout->subwin, theme_attrs(resource_presence_colour)); @@ -197,7 +197,7 @@ _rosterwin_contact(ProfLayoutSplit *layout, PContact contact) } g_string_append(msg, name); win_sub_newline_lazy(layout->subwin); - win_sub_print_nowrap(layout->subwin, msg->str, FALSE); + win_sub_print(layout->subwin, msg->str, FALSE, FALSE); g_string_free(msg, TRUE); wattroff(layout->subwin, theme_attrs(presence_colour)); @@ -228,7 +228,7 @@ _rosterwin_contacts_by_presence(ProfLayoutSplit *layout, const char *const prese if (prefs_get_boolean(PREF_ROSTER_COUNT)) { g_string_append_printf(title_str, " (%d)", g_slist_length(contacts)); } - win_sub_print_nowrap(layout->subwin, title_str->str, FALSE); + win_sub_print(layout->subwin, title_str->str, FALSE, FALSE); g_string_free(title_str, TRUE); wattroff(layout->subwin, theme_attrs(THEME_ROSTER_HEADER)); } @@ -272,7 +272,7 @@ _rosterwin_contacts_by_group(ProfLayoutSplit *layout, char *group, gboolean newl if (prefs_get_boolean(PREF_ROSTER_COUNT)) { g_string_append_printf(title, " (%d)", g_slist_length(contacts)); } - win_sub_print_nowrap(layout->subwin, title->str, FALSE); + win_sub_print(layout->subwin, title->str, FALSE, FALSE); g_string_free(title, TRUE); wattroff(layout->subwin, theme_attrs(THEME_ROSTER_HEADER)); @@ -315,7 +315,7 @@ _rosterwin_contacts_by_no_group(ProfLayoutSplit *layout, gboolean newline) if (prefs_get_boolean(PREF_ROSTER_COUNT)) { g_string_append_printf(title, " (%d)", g_slist_length(contacts)); } - win_sub_print_nowrap(layout->subwin, title->str, FALSE); + win_sub_print(layout->subwin, title->str, FALSE, FALSE); g_string_free(title, TRUE); wattroff(layout->subwin, theme_attrs(THEME_ROSTER_HEADER)); @@ -387,7 +387,7 @@ rosterwin_roster(void) if (prefs_get_boolean(PREF_ROSTER_COUNT)) { g_string_append_printf(title, " (%d)", g_slist_length(contacts)); } - win_sub_print_nowrap(layout->subwin, title->str, FALSE); + win_sub_print(layout->subwin, title->str, FALSE, FALSE); g_string_free(title, TRUE); wattroff(layout->subwin, theme_attrs(THEME_ROSTER_HEADER)); diff --git a/src/ui/window.c b/src/ui/window.c index d6a87fc6..b8e2a59d 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -1266,7 +1266,7 @@ win_unread(ProfWin *window) } void -win_sub_print_nowrap(WINDOW *win, char *msg, gboolean newline) +win_sub_print(WINDOW *win, char *msg, gboolean newline, gboolean wrap) { int maxx = getmaxx(win); int curx = getcurx(win); diff --git a/src/ui/window.h b/src/ui/window.h index a8424369..41765276 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -67,7 +67,7 @@ void win_newline(ProfWin *window); void win_redraw(ProfWin *window); int win_roster_cols(void); int win_occpuants_cols(void); -void win_sub_print_nowrap(WINDOW *win, char *msg, gboolean newline); +void win_sub_print(WINDOW *win, char *msg, gboolean newline, gboolean wrap); void win_sub_newline_lazy(WINDOW *win); void win_mark_received(ProfWin *window, const char *const id);