From 268b0823860274d6079c5dd307770a0769d404ef Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Thu, 25 Mar 2004 11:44:59 +0000 Subject: 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 --- screen_utils.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'screen_utils.c') 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; +} -- cgit v1.2.3