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

Renamed subwin functions

This commit is contained in:
James Booth 2015-11-22 00:54:40 +00:00
parent b4482b9fe1
commit 3d1299eb1e
4 changed files with 27 additions and 27 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_print_nowrap(layout->subwin, msg->str, TRUE);
win_sub_print_nowrap(layout->subwin, msg->str, TRUE);
g_string_free(msg, TRUE);
if (showjid && occupant->jid) {
GString *msg = g_string_new(" ");
g_string_append(msg, occupant->jid);
win_print_nowrap(layout->subwin, msg->str, TRUE);
win_sub_print_nowrap(layout->subwin, msg->str, TRUE);
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_print_nowrap(layout->subwin, " -Moderators", TRUE);
win_sub_print_nowrap(layout->subwin, " -Moderators", TRUE);
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_print_nowrap(layout->subwin, " -Participants", TRUE);
win_sub_print_nowrap(layout->subwin, " -Participants", TRUE);
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_print_nowrap(layout->subwin, " -Visitors", TRUE);
win_sub_print_nowrap(layout->subwin, " -Visitors", TRUE);
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_print_nowrap(layout->subwin, " -Occupants\n", TRUE);
win_sub_print_nowrap(layout->subwin, " -Occupants\n", TRUE);
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_print_nowrap(layout->subwin, msg->str, FALSE);
win_sub_print_nowrap(layout->subwin, msg->str, FALSE);
g_string_free(msg, TRUE);
wattroff(layout->subwin, theme_attrs(colour));
} else {
@ -78,8 +78,8 @@ _rosterwin_presence(ProfLayoutSplit *layout, theme_item_t colour, const char *pr
current_indent--;
}
g_string_append_printf(msg, "\"%s\"", status);
win_newline_lazy(layout->subwin);
win_print_nowrap(layout->subwin, msg->str, FALSE);
win_sub_newline_lazy(layout->subwin);
win_sub_print_nowrap(layout->subwin, msg->str, 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_print_nowrap(layout->subwin, msg->str, FALSE);
win_sub_print_nowrap(layout->subwin, msg->str, FALSE);
g_string_free(msg, TRUE);
wattroff(layout->subwin, theme_attrs(colour));
} else {
@ -115,8 +115,8 @@ _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_newline_lazy(layout->subwin);
win_print_nowrap(layout->subwin, msg->str, FALSE);
win_sub_newline_lazy(layout->subwin);
win_sub_print_nowrap(layout->subwin, msg->str, FALSE);
g_string_free(msg, TRUE);
wattroff(layout->subwin, theme_attrs(colour));
}
@ -150,8 +150,8 @@ _rosterwin_resources(ProfLayoutSplit *layout, PContact contact, int current_inde
if (prefs_get_boolean(PREF_ROSTER_PRIORITY)) {
g_string_append_printf(msg, " %d", resource->priority);
}
win_newline_lazy(layout->subwin);
win_print_nowrap(layout->subwin, msg->str, FALSE);
win_sub_newline_lazy(layout->subwin);
win_sub_print_nowrap(layout->subwin, msg->str, FALSE);
g_string_free(msg, TRUE);
wattroff(layout->subwin, theme_attrs(resource_presence_colour));
@ -196,8 +196,8 @@ _rosterwin_contact(ProfLayoutSplit *layout, PContact contact)
g_string_append_printf(msg, "%c", ch);
}
g_string_append(msg, name);
win_newline_lazy(layout->subwin);
win_print_nowrap(layout->subwin, msg->str, FALSE);
win_sub_newline_lazy(layout->subwin);
win_sub_print_nowrap(layout->subwin, msg->str, FALSE);
g_string_free(msg, TRUE);
wattroff(layout->subwin, theme_attrs(presence_colour));
@ -216,7 +216,7 @@ _rosterwin_contacts_by_presence(ProfLayoutSplit *layout, const char *const prese
// if this group has contacts, or if we want to show empty groups
if (contacts || prefs_get_boolean(PREF_ROSTER_EMPTY)) {
if (newline) {
win_newline_lazy(layout->subwin);
win_sub_newline_lazy(layout->subwin);
}
wattron(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
GString *title_str = g_string_new(" ");
@ -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_print_nowrap(layout->subwin, title_str->str, FALSE);
win_sub_print_nowrap(layout->subwin, title_str->str, FALSE);
g_string_free(title_str, TRUE);
wattroff(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
}
@ -260,7 +260,7 @@ _rosterwin_contacts_by_group(ProfLayoutSplit *layout, char *group, gboolean newl
if (contacts || prefs_get_boolean(PREF_ROSTER_EMPTY)) {
if (newline) {
win_newline_lazy(layout->subwin);
win_sub_newline_lazy(layout->subwin);
}
wattron(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
GString *title = g_string_new(" ");
@ -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_print_nowrap(layout->subwin, title->str, FALSE);
win_sub_print_nowrap(layout->subwin, title->str, FALSE);
g_string_free(title, TRUE);
wattroff(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
@ -302,7 +302,7 @@ _rosterwin_contacts_by_no_group(ProfLayoutSplit *layout, gboolean newline)
if (contacts || prefs_get_boolean(PREF_ROSTER_EMPTY)) {
if (newline) {
win_newline_lazy(layout->subwin);
win_sub_newline_lazy(layout->subwin);
}
wattron(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
GString *title = g_string_new(" ");
@ -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_print_nowrap(layout->subwin, title->str, FALSE);
win_sub_print_nowrap(layout->subwin, title->str, 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_print_nowrap(layout->subwin, title->str, FALSE);
win_sub_print_nowrap(layout->subwin, title->str, 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_print_nowrap(WINDOW *win, char *msg, gboolean newline)
win_sub_print_nowrap(WINDOW *win, char *msg, gboolean newline)
{
int maxx = getmaxx(win);
int curx = getcurx(win);
@ -1280,7 +1280,7 @@ win_print_nowrap(WINDOW *win, char *msg, gboolean newline)
}
void
win_newline_lazy(WINDOW *win)
win_sub_newline_lazy(WINDOW *win)
{
int curx = getcurx(win);
if (curx > 0) {

View File

@ -67,8 +67,8 @@ void win_newline(ProfWin *window);
void win_redraw(ProfWin *window);
int win_roster_cols(void);
int win_occpuants_cols(void);
void win_print_nowrap(WINDOW *win, char *msg, gboolean newline);
void win_newline_lazy(WINDOW *win);
void win_sub_print_nowrap(WINDOW *win, char *msg, gboolean newline);
void win_sub_newline_lazy(WINDOW *win);
void win_mark_received(ProfWin *window, const char *const id);
gboolean win_has_active_subwin(ProfWin *window);