X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_slkattr.c;h=da82ee5b623ec64fbbd5419092c6cb8122046003;hp=a13240324e5136c53bdbb0ed3584ad78be767ff3;hb=772f879d17117c5b766022f28099e341ebea825b;hpb=0eb88fc5281804773e2a0c7a488a4452463535ce diff --git a/ncurses/base/lib_slkattr.c b/ncurses/base/lib_slkattr.c index a1324032..da82ee5b 100644 --- a/ncurses/base/lib_slkattr.c +++ b/ncurses/base/lib_slkattr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 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 * @@ -27,8 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * - * and: Eric S. Raymond * + * Author: Juergen Pfeifer, 1997 * + * and: Thomas E. Dickey 2005 * ****************************************************************************/ /* @@ -38,17 +38,19 @@ */ #include -MODULE_ID("$Id: lib_slkattr.c,v 1.3 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_slkattr.c,v 1.6 2005/01/08 21:44:28 tom Exp $") -attr_t +NCURSES_EXPORT(attr_t) slk_attr(void) { - T((T_CALLED("slk_attr()"))); + T((T_CALLED("slk_attr()"))); - if (SP!=0 && SP->_slk!=0) - { - returnAttr(SP->_slk->attr); - } - else - returnAttr(0); + if (SP != 0 && SP->_slk != 0) { + attr_t result = AttrOf(SP->_slk->attr) & ALL_BUT_COLOR; + int pair = GetPair(SP->_slk->attr); + + result |= COLOR_PAIR(pair); + returnAttr(result); + } else + returnAttr(0); }