1 /* ncmpc (Ncurses MPD Client)
2 * (c) 2004-2010 The Music Player Daemon Project
3 * Project homepage: http://musicpd.org
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * Sets the specified color, and enables "reverse" mode if selected is
31 row_color(WINDOW
*w
, enum color color
, bool selected
)
36 wattron(w
, A_REVERSE
);
38 wattroff(w
, A_REVERSE
);
42 * Call this when you are done with painting rows. It resets the
46 row_color_end(WINDOW
*w
)
48 wattroff(w
, A_REVERSE
);
52 * Clears the remaining space on the current row. If the row is
53 * selected and the wide_cursor option is enabled, it draws the cursor
57 row_clear_to_eol(WINDOW
*w
, unsigned width
, bool selected
)
59 if (selected
&& options
.wide_cursor
)
60 whline(w
, ' ', width
);
66 * Paint a plain-text row.
69 row_paint_text(WINDOW
*w
, unsigned width
,
70 enum color color
, bool selected
,
73 row_color(w
, color
, selected
);
77 /* erase the unused space after the text */
78 row_clear_to_eol(w
, width
, selected
);