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