подпрограммы библиотеки Curses для управления атрибутами символов и окон (curses character and window attribute control routines)
Портативность (Portability)
These functions are supported in the XSI Curses standard, Issue
4. The standard defined the dedicated type for highlights,
attr_t
, which was not defined in SVr4 curses. The functions
taking attr_t
arguments were not supported under SVr4.
Very old versions of this library did not force an update of the
screen when changing the attributes. Use touchwin
to force the
screen to match the updated attributes.
The XSI Curses standard states that whether the traditional
functions attron
/attroff
/attrset
can manipulate attributes other
than A_BLINK
, A_BOLD
, A_DIM
, A_REVERSE
, A_STANDOUT
, or
A_UNDERLINE
is 'unspecified'. Under this implementation as well
as SVr4 curses, these functions correctly manipulate all other
highlights (specifically, A_ALTCHARSET
, A_PROTECT
, and A_INVIS
).
XSI Curses added these entry points:
attr_get
, attr_on
, attr_off
, attr_set
, wattr_on
,
wattr_off
, wattr_get
, wattr_set
The new functions are intended to work with a new series of
highlight macros prefixed with WA_
. The older macros have direct
counterparts in the newer set of names:
Name Description
────────────────────────────────────────────────────────────
WA_NORMAL
Normal display (no highlight)
WA_STANDOUT
Best highlighting mode of the terminal.
WA_UNDERLINE
Underlining
WA_REVERSE
Reverse video
WA_BLINK
Blinking
WA_DIM
Half bright
WA_BOLD
Extra bright or bold
WA_ALTCHARSET
Alternate character set
XSI curses does not assign values to these symbols, nor does it
state whether or not they are related to the similarly-named
A_NORMAL, etc.:
• The XSI curses standard specifies that each pair of
corresponding A_
and WA_
-using functions operates on the same
current-highlight information.
• However, in some implementations, those symbols have
unrelated values.
For example, the Solaris xpg4 (X/Open) curses declares attr_t
to be an unsigned short integer (16-bits), while chtype
is a
unsigned integer (32-bits). The WA_
symbols in this case are
different from the A_
symbols because they are used for a
smaller datatype which does not represent A_CHARTEXT
or
A_COLOR
.
In this implementation (as in many others), the values happen
to be the same because it simplifies copying information
between chtype
and cchar_t
variables.
The XSI standard extended conformance level adds new highlights
A_HORIZONTAL
, A_LEFT
, A_LOW
, A_RIGHT
, A_TOP
, A_VERTICAL
(and
corresponding WA_
macros for each). As of August 2013, no known
terminal provides these highlights (i.e., via the sgr1
capability).