1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Pass wrap boolean to win_sub_print()

This commit is contained in:
James Booth 2015-11-22 01:00:14 +00:00
parent 3d1299eb1e
commit 0763bfc9f4
4 changed files with 18 additions and 18 deletions

View File

@ -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) {

View File

@ -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));

View File

@ -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);

View File

@ -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);