2 .\" $Id: curs_attr.3x,v 1.14 1997/12/13 22:38:46 tom Exp $
5 \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR,
6 \fBattrset\fR, \fBwattrset\fR, \fBstandend\fR, \fBwstandend\fR, \fBstandout\fR,
7 \fBwstandout\fR - \fBcurses\fR character and window attribute control routines
9 \fB#include <curses.h>\fR
11 \fBint attroff(int attrs);\fR
13 \fBint wattroff(WINDOW *win, int attrs);\fR
15 \fBint attron(int attrs);\fR
17 \fBint wattron(WINDOW *win, int attrs);\fR
19 \fBint attrset(int attrs);\fR
21 \fBint wattrset(WINDOW *win, int attrs);\fR
23 \fBint standend(void);\fR
25 \fBint wstandend(WINDOW *win);\fR
27 \fBint standout(void);\fR
29 \fBint wstandout(WINDOW *win);\fR
31 \fBattr_t attr_get(void);\fR
33 \fBattr_t wattr_get(WINDOW *);\fR
35 \fBint attr_off(attr_t attrs);\fR
37 \fBint wattr_off(WINDOW *, attr_t attrs);\fR
39 \fBint attr_on(attr_t attrs);\fR
41 \fBint wattr_on(WINDOW *, attr_t attrs);\fR
43 \fBint attr_set(attr_t attrs);\fR
45 \fBint wattr_set(WINDOW *, attr_t attrs);\fR
47 \fBint chgat(int n, attr_t attr, short color, const void *opts)\fR
49 \fBint wchgat(WINDOW *, int n, attr_t attr,
50 short color, const void *opts)\fR
52 \fBint mvchgat(int y, int x, int n, attr_t attr,
53 short color, const void *opts)\fR
55 \fBint mvwchgat(WINDOW *, int y, int x, int n, attr_t attr,
56 short color, const void *opts)\fR
59 These routines manipulate the current attributes of the named window. The
60 current attributes of a window apply to all characters that are written into
61 the window with \fBwaddch\fR, \fBwaddstr\fR and \fBwprintw\fR. Attributes are
62 a property of the character, and move with the character through any scrolling
63 and insert/delete line/character operations. To the extent possible, they are
64 displayed as appropriate modifications to the graphic rendition of characters
67 The routine \fBattrset\fR sets the current attributes of the given window to
68 \fIattrs\fR. The routine \fBattroff\fR turns off the named attributes without
69 turning any other attributes on or off. The routine \fBattron\fR turns on the
70 named attributes without affecting any others. The routine \fBstandout\fR is
71 the same as \fBattron(A_STANDOUT)\fR. The routine \fBstandend\fR is the same
72 as \fBattrset(A_NORMAL)\fR or \fBattrset(0)\fR, that is, it turns off all
75 The routine \fBwattr_get\fR returns the current attribute for the given
76 window; \fBattr_get\fR returns the current attribute for \fBstdscr\fR.
77 The remaining \fBattr_\fR* functions operate exactly like the corresponding
78 \fBattr\fR* functions, except that they take arguments of type \fBattr_t\fR
79 rather than \fBint\fR.
81 The routine \fBchgat\fR changes the attributes of a given number of characters
82 starting at the current cursor location of \fBstdscr\fR. It does not update
83 the cursor and does not perform wrapping. A character count of -1 or greater
84 than the remaining window width means to change attributes all the way to the
85 end of the current line. The \fBwchgat\fR function generalizes this to any
86 window; the \fBmvwchgat\fR function does a cursor move before acting. In these
87 functions, the color argument is a color-pair index (as in the first argument
88 of \fIinit_pair\fR, see \fBcurs_color\fR(3X)). The \fBopts\fR argument is not
89 presently used, but is reserved for the future (leave it \fBNULL\fR).
91 The following video attributes, defined in \fB<curses.h>\fR, can be passed to
92 the routines \fBattron\fR, \fBattroff\fR, and \fBattrset\fR, or OR'ed with the
93 characters passed to \fBaddch\fR.
98 \fBA_NORMAL\fR Normal display (no highlight)
99 \fBA_STANDOUT\fR Best highlighting mode of the terminal.
100 \fBA_UNDERLINE\fR Underlining
101 \fBA_REVERSE\fR Reverse video
102 \fBA_BLINK\fR Blinking
103 \fBA_DIM\fR Half bright
104 \fBA_BOLD\fR Extra bright or bold
105 \fBA_PROTECT\fR Protected mode
106 \fBA_INVIS\fR Invisible or blank mode
107 \fBA_ALTCHARSET\fR Alternate character set
108 \fBA_CHARTEXT\fR Bit-mask to extract a character
109 \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR Color-pair number \fIn\fR
112 The following macro is the reverse of \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR:
115 \fBPAIR_NUMBER(\fIattrs\fR) Returns the pair number associated
116 with the \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR attribute.
119 The return values of many of these routines are not meaningful (they are
120 implemented as macro-expanded assignments and simply return their argument).
121 The SVr4 manual page claims (falsely) that these routines always return \fB1\fR.
124 Note that \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR,
125 \fBattrset\fR, \fBwattrset\fR, \fBstandend\fR and \fBstandout\fR may be macros.
127 All these functions are supported in the XSI Curses standard, Issue 4. The
128 standard defined the dedicated type for highlights, \fBattr_t\fR, which is not
129 defined in SVr4 curses. The functions taking \fBattr_t\fR arguments are
130 not supported under SVr4.
132 The XSI Curses standard states that whether the traditional functions
133 \fBattron\fR/\fBattroff\fR/\fBattrset\fR can manipulate attributes other than
134 \fBA_BLINK\fR, \fBA_BOLD\fR, \fBA_DIM\fR, \fBA_REVERSE\fR, \fBA_STANDOUT\fR, or
135 \fBA_UNDERLINE\fR is "unspecified". Under this implementation as well as
136 SVr4 curses, these functions correctly manipulate all other highlights
137 (specifically, \fBA_ALTCHARSET\fR, \fBA_PROTECT\fR, and \fBA_INVIS\fR).
139 XSI Curses added the new entry points, \fBattr_get\fR, \fBattr_on\fR,
140 \fBattr_off\fR, \fBattr_set\fR, \fBwattr_on\fR, \fBwattr_off\fR,
141 \fBwattr_get\fR, \fBwattr_set\fR. These are intended to work with
142 a new series of highlight macros prefixed with \fBWA_\fR.
147 \fBWA_NORMAL\fR Normal display (no highlight)
148 \fBWA_STANDOUT\fR Best highlighting mode of the terminal.
149 \fBWA_UNDERLINE\fR Underlining
150 \fBWA_REVERSE\fR Reverse video
151 \fBWA_BLINK\fR Blinking
152 \fBWA_DIM\fR Half bright
153 \fBWA_BOLD\fR Extra bright or bold
154 \fBWA_ALTCHARSET\fR Alternate character set
157 The XSI curses standard specifies that each pair of corresponding \fBA_\fR
158 and \fBWA_\fR-using functions operates on the same current-highlight
161 The XSI standard extended conformance level adds new highlights
162 \fBA_HORIZONTAL\fR, \fBA_LEFT\fR, \fBA_LOW\fR, \fBA_RIGHT\fR, \fBA_TOP\fR,
163 \fBA_VERTICAL\fR (and corresponding \fBWA_\fR macros for each) which this
164 curses does not yet support.
166 \fBcurses\fR(3X), \fBcurs_addch\fR(3X), \fBcurs_addstr\fR(3X),
167 \fBcurs_printw\fR(3X)
169 .\"# The following sets edit modes for GNU EMACS
170 .\"# Local Variables: