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