diff options
author | Kalle Wallin <kaw@linux.se> | 2004-03-25 11:44:59 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-03-25 11:44:59 +0000 |
commit | 268b0823860274d6079c5dd307770a0769d404ef (patch) | |
tree | 25dea360c739fca9ad931caa1f1aab320770338e /screen_utils.c | |
parent | 6777db4e48d23b9841ebd5e081c8dd3f4437a586 (diff) | |
download | mpd-268b0823860274d6079c5dd307770a0769d404ef.tar.gz mpd-268b0823860274d6079c5dd307770a0769d404ef.tar.xz mpd-268b0823860274d6079c5dd307770a0769d404ef.zip |
Added support for a configuration file ~/.ncmpcrc and color support.
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@473 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | screen_utils.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/screen_utils.c b/screen_utils.c index 49bd6692a..648291f03 100644 --- a/screen_utils.c +++ b/screen_utils.c @@ -8,6 +8,7 @@ #include "mpc.h" #include "support.h" #include "command.h" +#include "options.h" #include "screen.h" char * @@ -33,3 +34,30 @@ screen_readln(WINDOW *w, char *prompt) return line; } +int +my_waddstr(WINDOW *w, const char *text, int color) +{ + int ret; + + if( options.enable_colors ) + wattron(w, color); + ret = waddstr(w, text); + if( options.enable_colors ) + wattroff(w, color); + + return ret; +} + +int +my_mvwaddstr(WINDOW *w, int x, int y, const char *text, int color) +{ + int ret; + + if( options.enable_colors ) + wattron(w, color); + ret = mvwaddstr(w, x, y, text); + if( options.enable_colors ) + wattroff(w, color); + + return ret; +} |