]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_attr.3x
ncurses 6.2 - patch 20210313
[ncurses.git] / man / curs_attr.3x
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
4 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
5 .\"                                                                          *
6 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
7 .\" copy of this software and associated documentation files (the            *
8 .\" "Software"), to deal in the Software without restriction, including      *
9 .\" without limitation the rights to use, copy, modify, merge, publish,      *
10 .\" distribute, distribute with modifications, sublicense, and/or sell       *
11 .\" copies of the Software, and to permit persons to whom the Software is    *
12 .\" furnished to do so, subject to the following conditions:                 *
13 .\"                                                                          *
14 .\" The above copyright notice and this permission notice shall be included  *
15 .\" in all copies or substantial portions of the Software.                   *
16 .\"                                                                          *
17 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24 .\"                                                                          *
25 .\" Except as contained in this notice, the name(s) of the above copyright   *
26 .\" holders shall not be used in advertising or otherwise to promote the     *
27 .\" sale, use or other dealings in this Software without prior written       *
28 .\" authorization.                                                           *
29 .\"***************************************************************************
30 .\"
31 .\" $Id: curs_attr.3x,v 1.66 2020/02/02 23:34:34 tom Exp $
32 .TH curs_attr 3X ""
33 .ie \n(.g .ds `` \(lq
34 .el       .ds `` ``
35 .ie \n(.g .ds '' \(rq
36 .el       .ds '' ''
37 .de NS
38 .ie n  .sp
39 .el    .sp .5
40 .ie n  .in +4
41 .el    .in +2
42 .nf
43 .ft C                   \" Courier
44 ..
45 .de NE
46 .fi
47 .ft R
48 .ie n  .in -4
49 .el    .in -2
50 ..
51 .de bP
52 .ie n  .IP \(bu 4
53 .el    .IP \(bu 2
54 ..
55 .na
56 .hy 0
57 .\" ---------------------------------------------------------------------------
58 .SH NAME
59 .\" attr_get
60 \fBattr_get\fR,
61 \fBwattr_get\fR,
62 \fBattr_set\fR,
63 \fBwattr_set\fR,
64 .\" .br
65 \fBattr_off\fR,
66 \fBwattr_off\fR,
67 \fBattr_on\fR,
68 \fBwattr_on\fR,
69 .\" .br
70 \fBattroff\fR,
71 \fBwattroff\fR,
72 \fBattron\fR,
73 \fBwattron\fR,
74 \fBattrset\fR,
75 \fBwattrset\fR,
76 .\" .br
77 \fBchgat\fR,
78 \fBwchgat\fR,
79 \fBmvchgat\fR,
80 \fBmvwchgat\fR,
81 .\" .br
82 \fBcolor_set\fR,
83 \fBwcolor_set\fR,
84 .\" .br
85 \fBstandend\fR,
86 \fBwstandend\fR,
87 \fBstandout\fR,
88 \fBwstandout\fR \- \fBcurses\fR character and window attribute control routines
89 .ad
90 .hy
91 .\" ---------------------------------------------------------------------------
92 .SH SYNOPSIS
93 \fB#include <curses.h>\fR
94 .sp
95 \fBint attr_get(attr_t *\fP\fIattrs\fP\fB, short *\fP\fIpair\fP\fB, void *\fP\fIopts\fP\fB);\fR
96 .br
97 \fBint wattr_get(WINDOW *\fP\fIwin\fP\fB, attr_t *\fP\fIattrs\fP\fB, short *\fP\fIpair\fP\fB,\fR \fBvoid *\fP\fIopts\fP\fB);\fR
98 .br
99 \fBint attr_set(attr_t \fP\fIattrs\fP\fB, short \fP\fIpair\fP\fB, void *\fP\fIopts\fP\fB);\fR
100 .br
101 \fBint wattr_set(WINDOW *\fP\fIwin\fP\fB, attr_t \fP\fIattrs\fP\fB, short \fP\fIpair\fP\fB, void *\fP\fIopts\fP\fB);\fR
102 .sp
103 \fBint attr_off(attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
104 .br
105 \fBint wattr_off(WINDOW *\fP\fIwin\fP\fB, attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
106 .br
107 \fBint attr_on(attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
108 .br
109 \fBint wattr_on(WINDOW *\fP\fIwin\fP\fB, attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
110 .sp
111 \fBint attroff(int \fP\fIattrs);\fR
112 .br
113 \fBint wattroff(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR
114 .br
115 \fBint attron(int \fP\fIattrs\fP\fB);\fR
116 .br
117 \fBint wattron(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR
118 .br
119 \fBint attrset(int \fP\fIattrs\fP\fB);\fR
120 .br
121 \fBint wattrset(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR
122 .sp
123 \fBint chgat(int \fP\fIn\fP\fB, attr_t \fP\fIattr\fP\fB, short \fP\fIpair\fP\fB,\fR \fBconst void *\fP\fIopts\fP\fB);\fR
124 .br
125 \fBint wchgat(WINDOW *\fP\fIwin\fP\fB,\fP
126       \fBint \fP\fIn\fP\fB, attr_t \fP\fIattr\fP\fB,\fR \fBshort \fP\fIpair\fP\fB, const void *\fP\fIopts\fP\fB);\fR
127 .br
128 \fBint mvchgat(int \fP\fIy\fP\fB, int \fP\fIx\fP\fB,\fP
129       \fBint \fP\fIn\fP\fB, attr_t \fP\fIattr\fP\fB,\fR \fBshort \fP\fIpair\fP\fB, const void *\fP\fIopts\fP\fB);\fR
130 .br
131 \fBint mvwchgat(WINDOW *\fP\fIwin, int \fP\fIy, int \fP\fIx\fP\fB,\fP
132       \fBint \fP\fIn,\fR \fBattr_t \fP\fIattr\fP\fB, short \fP\fIpair\fP\fB, const void *\fP\fIopts\fP\fB);\fR
133 .sp
134 \fBint color_set(short \fP\fIpair\fP\fB, void* \fP\fIopts\fP\fB);\fR
135 .br
136 \fBint wcolor_set(WINDOW *\fP\fIwin\fP\fB, short \fP\fIpair\fP\fB,\fR \fBvoid* \fP\fIopts);\fR
137 .sp
138 \fBint standend(void);\fR
139 .br
140 \fBint wstandend(WINDOW *\fP\fIwin\fP\fB);\fR
141 .br
142 \fBint standout(void);\fR
143 .br
144 \fBint wstandout(WINDOW *\fP\fIwin\fP\fB);\fR
145 .\" ---------------------------------------------------------------------------
146 .SH DESCRIPTION
147 .PP
148 These routines manipulate the current attributes of the named window,
149 which then apply to all characters that are written into
150 the window with \fBwaddch\fR, \fBwaddstr\fR and \fBwprintw\fR.
151 Attributes are
152 a property of the character, and move with the character through any scrolling
153 and insert/delete line/character operations.
154 To the extent possible, they are
155 displayed as appropriate modifications to the graphic rendition of characters
156 put on the screen.
157 .PP
158 These routines do not affect the attributes used
159 when erasing portions of the window.
160 See \fBcurs_bkgd\fR(3X) for functions which modify the attributes used for
161 erasing and clearing.
162 .PP
163 Routines which do not have a \fBWINDOW*\fP parameter apply to \fBstdscr\fP.
164 For example,
165 \fBattr_set\fP is the \fBstdscr\fP variant of \fBwattr_set\fP.
166 .\" ---------------------------------------------------------------------------
167 .SS Window attributes
168 .PP
169 There are two sets of functions:
170 .bP
171 functions for manipulating the window attributes and color:
172 \fBwattr_set\fP and \fBwattr_get\fP.
173 .bP
174 functions for manipulating only the window attributes (not color):
175 \fBwattr_on\fP and \fBwattr_off\fP.
176 .PP
177 The \fBwattr_set\fP function sets the current attributes
178 of the given window to \fIattrs\fP, with color specified by \fIpair\fP.
179 .PP
180 Use \fBwattr_get\fP to retrieve attributes for the given window.
181 .PP
182 Use \fBattr_on\fP and \fBwattr_on\fP to turn on window attributes, i.e.,
183 values OR'd together in \fIattr\fP,
184 without affecting other attributes.
185 Use \fBattr_off\fP and \fBwattr_off\fP to turn off window attributes,
186 again values OR'd together in \fIattr\fP,
187 without affecting other attributes.
188 .\" ---------------------------------------------------------------------------
189 .SS Legacy window attributes
190 The X/Open window attribute routines which \fIset\fP or \fIget\fP,
191 turn \fIon\fP or \fIoff\fP
192 are extensions of older routines
193 which assume that color pairs are OR'd into the attribute parameter.
194 These newer routines use similar names, because
195 X/Open simply added an underscore (\fB_\fP) for the newer names.
196 .PP
197 The \fBint\fP datatype used in the legacy routines is treated as if
198 it is the same size as \fBchtype\fP (used by \fBaddch\fP(3X)).
199 It holds the common video attributes (such as bold, reverse),
200 as well as a few bits for color.
201 Those bits correspond to the \fBA_COLOR\fP symbol.
202 The \fBCOLOR_PAIR\fP macro provides a value which can be OR'd into
203 the attribute parameter.
204 For example,
205 as long as that value fits into the \fBA_COLOR\fP mask,
206 then these calls produce similar results:
207 .NS
208 attrset(A_BOLD | COLOR_PAIR(\fIpair\fP));
209 attr_set(A_BOLD, \fIpair\fP, NULL);
210 .NE
211 .PP
212 However, if the value does not fit, then the \fBCOLOR_PAIR\fP macro
213 uses only the bits that fit.
214 For example, because in ncurses \fBA_COLOR\fP has eight (8) bits,
215 then \fBCOLOR_PAIR(\fP\fI259\fP\fB)\fP is 4
216 (i.e., 259 is 4 more than the limit 255).
217 .PP
218 The \fBPAIR_NUMBER\fP macro extracts a pair number from an \fBint\fP
219 (or \fBchtype\fP).
220 For example, the \fIinput\fP and \fIoutput\fP values in these statements
221 would be the same:
222 .NS
223 int value = A_BOLD | COLOR_PAIR(\fIinput\fP);
224 int \fIoutput\fP = PAIR_NUMBER(value);
225 .NE
226 .PP
227 The \fBattrset\fP routine is a legacy feature predating SVr4 curses
228 but kept in X/Open Curses for the same reason that SVr4 curses kept it:
229 compatibility.
230 .PP
231 The remaining \fBattr\fR* functions operate exactly like the corresponding
232 \fBattr_\fR* functions, except that they take arguments of type \fBint\fR
233 rather than \fBattr_t\fR.
234 .PP
235 There is no corresponding \fBattrget\fP function as such in X/Open Curses,
236 although ncurses provides \fBgetattrs\fP (see curs_legacy(3X)).
237 .\" ---------------------------------------------------------------------------
238 .SS Change character rendition
239 .PP
240 The routine \fBchgat\fR changes the attributes of a given number of characters
241 starting at the current cursor location of \fBstdscr\fR.
242 It does not update
243 the cursor and does not perform wrapping.
244 A character count of \-1 or greater
245 than the remaining window width means to change attributes all the way to the
246 end of the current line.
247 The \fBwchgat\fR function generalizes this to any window;
248 the \fBmvwchgat\fR function does a cursor move before acting.
249 .PP
250 In these functions,
251 the color \fIpair\fP argument is a color-pair index
252 (as in the first argument of \fBinit_pair\fR, see \fBcurs_color\fR(3X)).
253 .\" ---------------------------------------------------------------------------
254 .SS Change window color
255 The routine \fBcolor_set\fR sets the current color of the given window to the
256 foreground/background combination described by the color \fIpair\fP parameter.
257 .\" ---------------------------------------------------------------------------
258 .SS Standout
259 .PP
260 The routine \fBstandout\fR is
261 the same as \fBattron(A_STANDOUT)\fR.
262 The routine \fBstandend\fR is the same
263 as \fBattrset(A_NORMAL)\fR or \fBattrset(0)\fR, that is, it turns off all
264 attributes.
265 .PP
266 X/Open does not mark these \*(``restricted\*('', because
267 .bP
268 they have well established legacy use, and
269 .bP
270 there is no ambiguity about the way the attributes
271 might be combined with a color pair.
272 .\" ---------------------------------------------------------------------------
273 .SH VIDEO ATTRIBUTES
274 The following video attributes, defined in \fB<curses.h>\fR, can be passed to
275 the routines \fBattron\fR, \fBattroff\fR, and \fBattrset\fR, or OR'd with the
276 characters passed to \fBaddch\fR (see \fBcurs_addch\fR(3X)).
277 .PP
278 .RS
279 .TS
280 l l
281 _ _ _
282 l l .
283 \fIName\fR      \fIDescription\fR
284 \fBA_NORMAL\fR  Normal display (no highlight)
285 \fBA_STANDOUT\fR        Best highlighting mode of the terminal.
286 \fBA_UNDERLINE\fR       Underlining
287 \fBA_REVERSE\fR Reverse video
288 \fBA_BLINK\fR   Blinking
289 \fBA_DIM\fR     Half bright
290 \fBA_BOLD\fR    Extra bright or bold
291 \fBA_PROTECT\fR Protected mode
292 \fBA_INVIS\fR   Invisible or blank mode
293 \fBA_ALTCHARSET\fR      Alternate character set
294 \fBA_ITALIC\fR  Italics (non-X/Open extension)
295 \fBA_CHARTEXT\fR        Bit-mask to extract a character
296 \fBA_COLOR\fR   Bit-mask to extract a color (legacy routines)
297 .TE
298 .RE
299 .PP
300 These video attributes are supported by \fBattr_on\fP and related functions
301 (which also support the attributes recognized by \fBattron\fP, etc.):
302 .RS
303 .TS
304 l l
305 _ _ _
306 l l .
307 \fIName\fR      \fIDescription\fR
308 \fBWA_HORIZONTAL\fR     Horizontal highlight
309 \fBWA_LEFT\fR   Left highlight
310 \fBWA_LOW\fR    Low highlight
311 \fBWA_RIGHT\fR  Right highlight
312 \fBWA_TOP\fR    Top highlight
313 \fBWA_VERTICAL\fR       Vertical highlight
314 .TE
315 .RE
316 .PP
317 The return values of many of these routines are not meaningful (they are
318 implemented as macro-expanded assignments and simply return their argument).
319 The SVr4 manual page claims (falsely) that these routines always return \fB1\fR.
320 .\" ---------------------------------------------------------------------------
321 .SH NOTES
322 These functions may be macros:
323 .sp
324 .RS
325 \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR,
326 \fBattrset\fR, \fBwattrset\fR, \fBstandend\fR and \fBstandout\fR.
327 .RE
328 .PP
329 Color pair values can only be OR'd with attributes if the pair
330 number is less than 256.
331 The alternate functions such as \fBcolor_set\fP can pass a color pair
332 value directly.
333 However, ncurses ABI 4 and 5 simply OR this value
334 within the alternate functions.
335 You must use ncurses ABI 6 to support more than 256 color pairs.
336 .\" ---------------------------------------------------------------------------
337 .SH HISTORY
338 X/Open Curses is largely based on SVr4 curses,
339 adding support for \*(``wide-characters\*('' (not specific to Unicode).
340 Some of the X/Open differences from SVr4 curses address the way
341 video attributes can be applied to wide-characters.
342 But aside from that, \fBattrset\fP and \fBattr_set\fP are similar.
343 SVr4 curses provided the basic features for manipulating video attributes.
344 However, earlier versions of curses provided a part of these features.
345 .PP
346 As seen in 2.8BSD, curses assumed 7-bit characters,
347 using the eighth bit of a byte to represent the \fIstandout\fP
348 feature (often implemented as bold and/or reverse video).
349 The BSD curses library provided functions \fBstandout\fP and \fBstandend\fP
350 which were carried along into X/Open Curses due to their pervasive use
351 in legacy applications.
352 .PP
353 Some terminals in the 1980s could support a variety of video attributes,
354 although the BSD curses library could do nothing with those.
355 System V (1983) provided an improved curses library.
356 It defined the \fBA_\fP symbols for use by applications to manipulate the
357 other attributes.
358 There are few useful references for the chronology.
359 .PP
360 Goodheart's book
361 \fIUNIX Curses Explained\fP (1991) describes SVr3 (1987),
362 commenting on several functions:
363 .bP
364 the \fBattron\fP, \fBattroff\fP, \fBattrset\fP functions
365 (and most of the functions found in SVr4 but not in BSD curses) were
366 introduced by System V,
367 .bP
368 the alternate character set feature with \fBA_ALTCHARSET\fP was
369 added in SVr2 and improved in SVr3 (by adding \fBacs_map[]\fP),
370 .bP
371 \fBstart_color\fP and related color-functions were introduced by System V.3.2,
372 .bP
373 pads, soft-keys were added in SVr3, and
374 .PP
375 Goodheart did not mention the background character or the \fBcchar_t\fP type.
376 Those are respectively SVr4 and X/Open features.
377 He did mention the \fBA_\fP constants, but did not indicate their values.
378 Those were not the same in different systems,
379 even for those marked as System V.
380 .PP
381 Different Unix systems used different sizes for the bit-fields in \fBchtype\fP
382 for \fIcharacters\fP and \fIcolors\fP, and took into account the different
383 integer sizes (32-bit versus 64-bit).
384 .PP
385 This table showing the number of bits for \fBA_COLOR\fP
386 and \fBA_CHARTEXT\fP
387 was gleaned from the curses header files for
388 various operating systems and architectures.
389 The inferred architecture and notes reflect
390 the format and size of the defined constants
391 as well as clues such as the alternate character set implementation.
392 A 32-bit library can be used on a 64-bit system,
393 but not necessarily the reverse.
394 .RS
395 .TS
396 l l l l l l
397 _ _ _ _ _ _
398 l l l l l l .
399 \fIYear\fR      \fISystem\fR    \fIArch\fP      \fIColor\fR     \fIChar\fR      \fINotes\fR
400 1992    Solaris 5.2     32      6       17      SVr4 curses
401 1992    HPUX 9  32      no      8       SVr2 curses
402 1992    AIX 3.2 32      no      23      SVr2 curses
403 1994    OSF/1 r3        32      no      23      SVr2 curses
404 1995    HP-UX 10.00     32      6       16      SVr3 \*(``curses_colr\*(''
405 1995    HP-UX 10.00     32      6       8       SVr4, X/Open curses
406 1995    Solaris 5.4     32/64   7       16      X/Open curses
407 1996    AIX 4.2 32      7       16      X/Open curses
408 1996    OSF/1 r4        32      6       16      X/Open curses
409 1997    HP-UX 11.00     32      6       8       X/Open curses
410 2000    U/Win   32/64   7/31    16      uses \fBchtype\fP
411 .TE
412 .RE
413 .PP
414 Notes:
415 .RS 3
416 .PP
417 Regarding HP-UX,
418 .bP
419 HP-UX 10.20 (1996) added support for 64-bit PA-RISC processors in 1996.
420 .bP
421 HP-UX 10.30 (1997) marked \*(``curses_colr\*('' obsolete.
422 That version of curses was dropped with HP-UX 11.30 in 2006.
423 .PP
424 Regarding OSF/1 (and Tru64),
425 .bP
426 These used 64-bit hardware.
427 Like ncurses, the OSF/1 curses interface is not customized for 32-bit
428 and 64-bit versions.
429 .bP
430 Unlike other systems which evolved from AT&T code,
431 OSF/1 provided a new implementation for X/Open curses.
432 .PP
433 Regarding Solaris,
434 .bP
435 The initial release of Solaris was in 1992.
436 .bP
437 The \fIxpg4\fP (X/Open) curses was developed by MKS from 1990 to 1995.
438 Sun's copyright began in 1996.
439 .bP
440 Sun updated the X/Open curses interface
441 after 64-bit support was introduced in 1997,
442 but did not modify the SVr4 curses interface.
443 .PP
444 Regarding U/Win,
445 .bP
446 Development of the curses library began in 1991, stopped in 2000.
447 .bP
448 Color support was added in 1998.
449 .bP
450 The library uses only \fBchtype\fP (no \fBcchar_t\fP).
451 .RE
452 .PP
453 Once X/Open curses was adopted in the mid-1990s, the constraint of
454 a 32-bit interface with many colors and wide-characters for \fBchtype\fP
455 became a moot point.
456 The \fBcchar_t\fP structure (whose size and
457 members are not specified in X/Open Curses) could be extended as needed.
458 .PP
459 Other interfaces are rarely used now:
460 .bP
461 BSD curses was improved slightly in 1993/1994 using Keith Bostic's
462 modification to make the library 8-bit clean for \fBnvi\fP.
463 He moved \fIstandout\fP attribute to a structure member.
464 .IP
465 The resulting 4.4BSD curses was replaced by ncurses over the next ten years.
466 .bP
467 U/Win is rarely used now.
468 .\" ---------------------------------------------------------------------------
469 .SH EXTENSIONS
470 .PP
471 This implementation provides the \fBA_ITALIC\fP attribute for terminals
472 which have the \fBenter_italics_mode\fP (\fBsitm\fP)
473 and \fBexit_italics_mode\fP (\fBritm\fP) capabilities.
474 Italics are not mentioned in X/Open Curses.
475 Unlike the other video attributes, \fBA_ITALIC\fP is unrelated
476 to the \fBset_attributes\fP capabilities.
477 This implementation makes the assumption that
478 \fBexit_attribute_mode\fP may also reset italics.
479 .PP
480 Each of the functions added by XSI Curses has a parameter \fIopts\fP,
481 which X/Open Curses still (after more than twenty years) documents
482 as reserved for future use, saying that it should be \fBNULL\fP.
483 This implementation uses that parameter in ABI 6 for the functions which
484 have a color-pair parameter to support \fIextended color pairs\fP:
485 .bP
486 For functions which modify the color, e.g.,
487 \fBwattr_set\fP,
488 if \fIopts\fP is set it is treated as a pointer to \fBint\fP,
489 and used to set the color pair instead of the \fBshort\fP \fIpair\fP parameter.
490 .bP
491 For functions which retrieve the color, e.g.,
492 \fBwattr_get\fP,
493 if \fIopts\fP is set it is treated as a pointer to \fBint\fP,
494 and used to retrieve the color pair as an \fBint\fP value,
495 in addition
496 retrieving it via the standard pointer to \fBshort\fP parameter.
497 .PP
498 The remaining functions which have \fIopts\fP,
499 but do not manipulate color,
500 e.g., \fBwattr_on\fP and \fBwattr_off\fP
501 are not used by this implementation except to check that they are \fBNULL\fP.
502 .\" ---------------------------------------------------------------------------
503 .SH PORTABILITY
504 These functions are supported in the XSI Curses standard, Issue 4.
505 The standard defined the dedicated type for highlights,
506 \fBattr_t\fR, which was not defined in SVr4 curses.
507 The functions taking \fBattr_t\fR arguments were not supported under SVr4.
508 .PP
509 Very old versions of this library did not force an update of the screen
510 when changing the attributes.
511 Use \fBtouchwin\fR to force the screen to match the updated attributes.
512 .PP
513 The XSI Curses standard states that whether the traditional functions
514 \fBattron\fR/\fBattroff\fR/\fBattrset\fR can manipulate attributes other than
515 \fBA_BLINK\fR, \fBA_BOLD\fR, \fBA_DIM\fR, \fBA_REVERSE\fR, \fBA_STANDOUT\fR, or
516 \fBA_UNDERLINE\fR is \*(``unspecified\*(''.
517 Under this implementation as well as
518 SVr4 curses, these functions correctly manipulate all other highlights
519 (specifically, \fBA_ALTCHARSET\fR, \fBA_PROTECT\fR, and \fBA_INVIS\fR).
520 .PP
521 XSI Curses added these entry points:
522 .sp
523 .RS
524 \fBattr_get\fR, \fBattr_on\fR,
525 \fBattr_off\fR, \fBattr_set\fR, \fBwattr_on\fR, \fBwattr_off\fR,
526 \fBwattr_get\fR, \fBwattr_set\fR
527 .RE
528 .PP
529 The new functions are intended to work with
530 a new series of highlight macros prefixed with \fBWA_\fR.
531 The older macros have direct counterparts in the newer set of names:
532 .PP
533 .RS
534 .ne 9
535 .TS
536 l l
537 _ _ _
538 l l .
539 \fIName\fR      \fIDescription\fR
540 \fBWA_NORMAL\fR Normal display (no highlight)
541 \fBWA_STANDOUT\fR       Best highlighting mode of the terminal.
542 \fBWA_UNDERLINE\fR      Underlining
543 \fBWA_REVERSE\fR        Reverse video
544 \fBWA_BLINK\fR  Blinking
545 \fBWA_DIM\fR    Half bright
546 \fBWA_BOLD\fR   Extra bright or bold
547 \fBWA_ALTCHARSET\fR     Alternate character set
548 .TE
549 .RE
550 .PP
551 XSI curses does not assign values to these symbols,
552 nor does it state whether or not they are related to the
553 similarly-named A_NORMAL, etc.:
554 .bP
555 The XSI curses standard specifies that each pair of corresponding \fBA_\fR
556 and \fBWA_\fR-using functions operates on the same current-highlight
557 information.
558 .bP
559 However, in some implementations, those symbols have unrelated values.
560 .IP
561 For example, the Solaris \fIxpg4\fP (X/Open) curses declares
562 \fBattr_t\fP to be an unsigned short integer (16-bits),
563 while \fBchtype\fP is a unsigned integer (32-bits).
564 The \fBWA_\fP symbols in this case are different from the \fBA_\fP symbols
565 because they are used for a smaller datatype which does not
566 represent \fBA_CHARTEXT\fP or \fBA_COLOR\fP.
567 .IP
568 In this implementation (as in many others), the values happen to be
569 the same because it simplifies copying information between
570 \fBchtype\fP and \fBcchar_t\fP variables.
571 .PP
572 The XSI standard extended conformance level adds new highlights
573 \fBA_HORIZONTAL\fR, \fBA_LEFT\fR, \fBA_LOW\fR, \fBA_RIGHT\fR, \fBA_TOP\fR,
574 \fBA_VERTICAL\fR (and corresponding \fBWA_\fR macros for each).
575 As of August 2013,
576 no known terminal provides these highlights
577 (i.e., via the \fBsgr1\fP capability).
578 .\" ---------------------------------------------------------------------------
579 .SH RETURN VALUE
580 All routines return the integer \fBOK\fR on success, or \fBERR\fP on failure.
581 .PP
582 X/Open does not define any error conditions.
583 .PP
584 This implementation
585 .bP
586 returns an error if the window pointer is null.
587 .bP
588 returns an error if the color pair parameter
589 for \fBwcolor_set\fP is outside the range 0..COLOR_PAIRS\-1.
590 .bP
591 does not return an error if either of the parameters of \fBwattr_get\fP
592 used for retrieving attribute or color-pair values is \fBNULL\fP.
593 .PP
594 Functions with a \*(``mv\*('' prefix first perform a cursor movement using
595 \fBwmove\fP, and return an error if the position is outside the window,
596 or if the window pointer is null.
597 .\" ---------------------------------------------------------------------------
598 .SH SEE ALSO
599 .na
600 \fBcurses\fR(3X),
601 \fBcurs_addch\fR(3X),
602 \fBcurs_addstr\fR(3X),
603 \fBcurs_bkgd\fR(3X),
604 \fBcurs_printw\fR(3X),
605 \fBcurs_variables\fR(3X)