X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_wattroff.c;h=bf2020e060278385dda73b2822d6fbfe8de920a2;hp=a6c9f0f1804e1daf540eb008c3d59d9f85e943ac;hb=f7b8e526e024ce141e61633e966255400de67772;hpb=0eb88fc5281804773e2a0c7a488a4452463535ce;ds=sidebyside diff --git a/ncurses/base/lib_wattroff.c b/ncurses/base/lib_wattroff.c index a6c9f0f1..bf2020e0 100644 --- a/ncurses/base/lib_wattroff.c +++ b/ncurses/base/lib_wattroff.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * ****************************************************************************/ /* @@ -41,15 +42,23 @@ #include #include -MODULE_ID("$Id: lib_wattroff.c,v 1.4 1998/05/10 12:02:11 tom Exp $") +MODULE_ID("$Id: lib_wattroff.c,v 1.9 2006/05/27 19:30:33 tom Exp $") -int wattr_off(WINDOW *win, NCURSES_CONST attr_t at, void *opts GCC_UNUSED) +NCURSES_EXPORT(int) +wattr_off(WINDOW *win, attr_t at, void *opts GCC_UNUSED) { - T((T_CALLED("wattr_off(%p,%s)"), win, _traceattr(at))); - if (win) { - T(("... current %s", _traceattr(win->_attrs))); - toggle_attr_off(win->_attrs,at); - returnCode(OK); - } else - returnCode(ERR); + T((T_CALLED("wattr_off(%p,%s)"), win, _traceattr(at))); + if (win) { + T(("... current %s (%d)", + _traceattr(WINDOW_ATTRS(win)), + GET_WINDOW_PAIR(win))); + + if_EXT_COLORS({ + if (at & A_COLOR) + win->_color = 0; + }); + toggle_attr_off(WINDOW_ATTRS(win), at); + returnCode(OK); + } else + returnCode(ERR); }