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