cursattr(3X) cursattr(3X)
NAME
attroff, wattroff, attron, wattron, attrset, wattrset, colorset,
wcolorset, standend, wstandend, standout, wstandout, attrget,
wattrget, attroff, wattroff, attron, wattron, attrset, wattrset,
chgat, wchgat, mvchgat, mvwchgat, PAIRNUMBER - curses character and
window attribute control routines
SYNOPSIS
##include <>
int attroff(int attrs);;
int wattroff(WINDOW **win,, int attrs);;
int attron(int attrs);;
int wattron(WINDOW **win,, int attrs);;
int attrset(int attrs);;
int wattrset(WINDOW **win,, int attrs);;
int colorset(short colorpairnumber,, void** opts);;
int wcolorset(WINDOW **win,, short colorpairnumber,,
void** opts);;
int standend(void);;
int wstandend(WINDOW **win);;
int standout(void);;
int wstandout(WINDOW **win);;
int attrget(attrt **attrs,, short **pair,, void **opts);;
int wattrget(WINDOW **win,, attrt **attrs,, short **pair,,
void **opts);;
int attroff(attrt attrs,, void **opts);;
int wattroff(WINDOW **win,, attrt attrs,, void **opts);;
int attron(attrt attrs,, void **opts);;
int wattron(WINDOW **win,, attrt attrs,, void **opts);;
int attrset(attrt attrs,, short pair,, void **opts);;
int wattrset(WINDOW **win,, attrt attrs,, short pair,, void **opts);;
int chgat(int n,, attrt attr,, short color,,
const void **opts)
int wchgat(WINDOW **win,, int n,, attrt attr,,
short color,, const void **opts)
int mvchgat(int y,, int x,, int n,, attrt attr,,
short color,, const void **opts)
int mvwchgat(WINDOW **win,, int y,, int x,, int n,,
attrt attr,, short color,, const void **opts)
DESCRIPTION
These routines manipulate the current attributes of the named window.
The current attributes of a window apply to all characters that are
written into the window with waddch, waddstr and wprintw. Attributes
are a property of the character, and move with the character through
any scrolling and insert/delete line/character operations. To the
extent possible, they are displayed as appropriate modifications to the
graphic rendition of characters put on the screen.
The routine attrset sets the current attributes of the given window to
attrs. The routine attroff turns off the named attributes without
turning any other attributes on or off. The routine attron turns on
the named attributes without affecting any others. The routine stand-
out is the same as attron(ASTANDOUT). The routine standend is the
same as attrset(ANORMAL) or attrset(00), that is, it turns off all
attributes.
The attrset and related routines do not affect the attributes used when
erasing portions of the window. See cursbkgd(3X) for functions which
modify the attributes used for erasing and clearing.
The routine colorset sets the current color of the given window to the
foreground/background combination described by the colorpairnumber.
The parameter opts is reserved for future use, applications must supply
a null pointer.
The routine wattrget returns the current attribute and color pair for
the given window; attrget returns the current attribute and color pair
for stdscr. The remaining attr* functions operate exactly like the
corresponding attr* functions, except that they take arguments of type
attrt rather than int.
The routine chgat changes the attributes of a given number of charac-
ters starting at the current cursor location of stdscr. It does not
update the cursor and does not perform wrapping. A character count of
-1 or greater than the remaining window width means to change
attributes all the way to the end of the current line. The wchgat
function generalizes this to any window; the mvwchgat function does a
cursor move before acting. In these functions, the color argument is a
color-pair index (as in the first argument of initpair, see
curscolor(3X)). The opts argument is not presently used, but is
reserved for the future (leave it NUL). Note that changing the
attributes does not imply that a subsequent refresh will update the
screen to match, since the character values are not modified. Use
touchwin to force the screen to match the updated attributes.
Attributes
The following video attributes, defined in <>, can be passed to
the routines attron, attroff, and attrset, or OR'ed with the characters
passed to addch.
ANORMAL Normal display (no highlight)
ASTANDOUT Best highlighting mode of the terminal.
AUNDERLINE Underlining
AREVERSE Reverse video
ABLINK Blinking
ADIM Half bright
ABOLD Extra bright or bold
APROTECT Protected mode
AINVIS Invisible or blank mode
ALTCHARSET Alternate character set
ACHARTEXT Bit-mask to extract a character
COLORPAIR(n) Color-pair number n
The following macro is the reverse of COLORPAIR(n):
PAIRNUMBER(attrs) Returns the pair number associated
with the COLORPAIR(n) attribute.
The return values of many of these routines are not meaningful (they
are implemented as macro-expanded assignments and simply return their
argument). The SVr4 manual page claims (falsely) that these routines
always return 1.
NOTES
Note that attroff, wattroff, attron, wattron, attrset, wattrset,
standend and standout may be macros.
PORTABILITY
All these functions are supported in the XSI Curses standard, Issue 4.
The standard defined the dedicated type for highlights, attrt, which
is not defined in SVr4 curses. The functions taking attrt arguments
are not supported under SVr4.
The XSI Curses standard states that whether the traditional functions
attron/attroff/attrset can manipulate attributes other than ABLINK,
ABOLD, ADIM, AREVERSE, ASTANDOUT, or AUNDERLINE is "unspecified".
Under this implementation as well as SVr4 curses, these functions cor-
rectly manipulate all other highlights (specifically, ALTCHARSET,
APROTECT, and AINVIS).
XSI Curses added the new entry points, attrget, attron, attroff,
attrset, wattron, wattroff, wattrget, wattrset. These are
intended to work with a new series of highlight macros prefixed with
WA.
WANORMAL Normal display (no highlight)
WASTANDOUT Best highlighting mode of the terminal.
WAUNDERLINE Underlining
WAREVERSE Reverse video
WABLINK Blinking
WADIM Half bright
WABOLD Extra bright or bold
WALTCHARSET Alternate character set
The XSI curses standard specifies that each pair of corresponding A
and WA-using functions operates on the same current-highlight informa-
tion.
The XSI standard extended conformance level adds new highlights AHORI-
ZONTAL, ALEFT, ALOW, ARIGHT, ATOP, AVERTICAL (and corresponding
WA macros for each) which this curses does not yet support.
SEE ALSO
curses(3X), cursaddch(3X), cursaddstr(3X), cursbkgd(3X),
cursprintw(3X)
cursattr(3X)
|