]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_attr.3x
ncurses 6.1 - patch 20180721
[ncurses.git] / man / curs_attr.3x
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998-2016,2017 Free Software Foundation, Inc.              *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: curs_attr.3x,v 1.62 2017/12/16 20:16:07 tom Exp $
31 .TH curs_attr 3X ""
32 .ie \n(.g .ds `` \(lq
33 .el       .ds `` ``
34 .ie \n(.g .ds '' \(rq
35 .el       .ds '' ''
36 .de NS
37 .ie n  .sp
38 .el    .sp .5
39 .ie n  .in +4
40 .el    .in +2
41 .nf
42 .ft C                   \" Courier
43 ..
44 .de NE
45 .fi
46 .ft R
47 .in -4
48 ..
49 .de bP
50 .ie n  .IP \(bu 4
51 .el    .IP \(bu 2
52 ..
53 .na
54 .hy 0
55 .\" ---------------------------------------------------------------------------
56 .SH NAME
57 .\" attr_get
58 \fBattr_get\fR,
59 \fBwattr_get\fR,
60 \fBattr_set\fR,
61 \fBwattr_set\fR,
62 .\" .br
63 \fBattr_off\fR,
64 \fBwattr_off\fR,
65 \fBattr_on\fR,
66 \fBwattr_on\fR,
67 .\" .br
68 \fBattroff\fR,
69 \fBwattroff\fR,
70 \fBattron\fR,
71 \fBwattron\fR,
72 \fBattrset\fR,
73 \fBwattrset\fR,
74 .\" .br
75 \fBchgat\fR,
76 \fBwchgat\fR,
77 \fBmvchgat\fR,
78 \fBmvwchgat\fR,
79 .\" .br
80 \fBcolor_set\fR,
81 \fBwcolor_set\fR,
82 .\" .br
83 \fBstandend\fR,
84 \fBwstandend\fR,
85 \fBstandout\fR,
86 \fBwstandout\fR \- \fBcurses\fR character and window attribute control routines
87 .ad
88 .hy
89 .\" ---------------------------------------------------------------------------
90 .SH SYNOPSIS
91 \fB#include <curses.h>\fR
92 .sp
93 \fBint attr_get(attr_t *\fP\fIattrs\fP\fB, short *\fP\fIpair\fP\fB, void *\fP\fIopts\fP\fB);\fR
94 .br
95 \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
96 .br
97 \fBint attr_set(attr_t \fP\fIattrs\fP\fB, short \fP\fIpair\fP\fB, void *\fP\fIopts\fP\fB);\fR
98 .br
99 \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
100 .sp
101 \fBint attr_off(attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
102 .br
103 \fBint wattr_off(WINDOW *\fP\fIwin\fP\fB, attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
104 .br
105 \fBint attr_on(attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
106 .br
107 \fBint wattr_on(WINDOW *\fP\fIwin\fP\fB, attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
108 .sp
109 \fBint attroff(int \fP\fIattrs);\fR
110 .br
111 \fBint wattroff(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR
112 .br
113 \fBint attron(int \fP\fIattrs\fP\fB);\fR
114 .br
115 \fBint wattron(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR
116 .br
117 \fBint attrset(int \fP\fIattrs\fP\fB);\fR
118 .br
119 \fBint wattrset(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR
120 .sp
121 \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
122 .br
123 \fBint wchgat(WINDOW *\fP\fIwin\fP\fB,\fP
124       \fBint \fP\fIn\fP\fB, attr_t \fP\fIattr\fP\fB,\fR \fBshort \fP\fIpair\fP\fB, const void *\fP\fIopts\fP\fB);\fR
125 .br
126 \fBint mvchgat(int \fP\fIy\fP\fB, int \fP\fIx\fP\fB,\fP
127       \fBint \fP\fIn\fP\fB, attr_t \fP\fIattr\fP\fB,\fR \fBshort \fP\fIpair\fP\fB, const void *\fP\fIopts\fP\fB);\fR
128 .br
129 \fBint mvwchgat(WINDOW *\fP\fIwin, int \fP\fIy, int \fP\fIx\fP\fB,\fP
130       \fBint \fP\fIn,\fR \fBattr_t \fP\fIattr\fP\fB, short \fP\fIpair\fP\fB, const void *\fP\fIopts\fP\fB);\fR
131 .sp
132 \fBint color_set(short \fP\fIpair\fP\fB, void* \fP\fIopts\fP\fB);\fR
133 .br
134 \fBint wcolor_set(WINDOW *\fP\fIwin\fP\fB, short \fP\fIpair\fP\fB,\fR \fBvoid* \fP\fIopts);\fR
135 .sp
136 \fBint standend(void);\fR
137 .br
138 \fBint wstandend(WINDOW *\fP\fIwin\fP\fB);\fR
139 .br
140 \fBint standout(void);\fR
141 .br
142 \fBint wstandout(WINDOW *\fP\fIwin\fP\fB);\fR
143 .\" ---------------------------------------------------------------------------
144 .SH DESCRIPTION
145 .PP
146 These routines manipulate the current attributes of the named window,
147 which then apply to all characters that are written into
148 the window with \fBwaddch\fR, \fBwaddstr\fR and \fBwprintw\fR.
149 Attributes are
150 a property of the character, and move with the character through any scrolling
151 and insert/delete line/character operations.
152 To the extent possible, they are
153 displayed as appropriate modifications to the graphic rendition of characters
154 put on the screen.
155 .PP
156 These routines do not affect the attributes used
157 when erasing portions of the window.
158 See \fBcurs_bkgd\fR(3X) for functions which modify the attributes used for
159 erasing and clearing.
160 .PP
161 Routines which do not have a \fBWINDOW*\fP parameter apply to \fBstdscr\fP.
162 For example,
163 \fBattr_set\fP is the \fBstdscr\fP variant of \fBwattr_set\fP.
164 .\" ---------------------------------------------------------------------------
165 .SS Window attributes
166 .PP
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(259)\fP is 4 (259\-255).
214 .PP
215 The \fBPAIR_NUMBER\fP macro extracts a pair number from an \fBint\fP
216 (or \fBchtype\fP).
217 For example, the \fIinput\fP and \fIoutput\fP values in these statements
218 would be the same:
219 .NS
220 int value = A_BOLD | COLOR_PAIR(\fIinput\fP);
221 int \fIoutput\fP = PAIR_NUMBER(value);
222 .NE
223 .PP
224 The \fBattrset\fP routine is a legacy feature predating SVr4 curses
225 but kept in X/Open Curses for the same reason that SVr4 curses kept it:
226 compatibility.
227 .PP
228 The remaining \fBattr\fR* functions operate exactly like the corresponding
229 \fBattr_\fR* functions, except that they take arguments of type \fBint\fR
230 rather than \fBattr_t\fR.
231 .PP
232 There is no corresponding \fBattrget\fP function as such in X/Open Curses,
233 although ncurses provides \fBgetattrs\fP (see curs_legacy(3X)).
234 .\" ---------------------------------------------------------------------------
235 .SS Change character rendition
236 .PP
237 The routine \fBchgat\fR changes the attributes of a given number of characters
238 starting at the current cursor location of \fBstdscr\fR.
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\fR function generalizes this to any window;
245 the \fBmvwchgat\fR 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\fR, see \fBcurs_color\fR(3X)).
250 .\" ---------------------------------------------------------------------------
251 .SS Change window color
252 The routine \fBcolor_set\fR 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 .PP
257 The routine \fBstandout\fR is
258 the same as \fBattron(A_STANDOUT)\fR.
259 The routine \fBstandend\fR is the same
260 as \fBattrset(A_NORMAL)\fR or \fBattrset(0)\fR, that is, it turns off all
261 attributes.
262 .PP
263 X/Open does not mark these "restricted", because
264 .bP
265 they have well established legacy use, and
266 .bP
267 there is no ambiguity about the way the attributes
268 might be combined with a color pair.
269 .\" ---------------------------------------------------------------------------
270 .SH VIDEO ATTRIBUTES
271 The following video attributes, defined in \fB<curses.h>\fR, can be passed to
272 the routines \fBattron\fR, \fBattroff\fR, and \fBattrset\fR, or OR'd with the
273 characters passed to \fBaddch\fR (see \fBcurs_addch\fR(3X)).
274 .PP
275 .RS
276 .TS
277 l l
278 _ _ _
279 l l .
280 \fIName\fR      \fIDescription\fR
281 \fBA_NORMAL\fR  Normal display (no highlight)
282 \fBA_STANDOUT\fR        Best highlighting mode of the terminal.
283 \fBA_UNDERLINE\fR       Underlining
284 \fBA_REVERSE\fR Reverse video
285 \fBA_BLINK\fR   Blinking
286 \fBA_DIM\fR     Half bright
287 \fBA_BOLD\fR    Extra bright or bold
288 \fBA_PROTECT\fR Protected mode
289 \fBA_INVIS\fR   Invisible or blank mode
290 \fBA_ALTCHARSET\fR      Alternate character set
291 \fBA_ITALIC\fR  Italics (non-X/Open extension)
292 \fBA_CHARTEXT\fR        Bit-mask to extract a character
293 \fBA_COLOR\fR   Bit-mask to extract a color (legacy routines)
294 .TE
295 .RE
296 .PP
297 These video attributes are supported by \fBattr_on\fP and related functions
298 (which also support the attributes recognized by \fBattron\fP, etc.):
299 .RS
300 .TS
301 l l
302 _ _ _
303 l l .
304 \fIName\fR      \fIDescription\fR
305 \fBWA_HORIZONTAL\fR     Horizontal highlight
306 \fBWA_LEFT\fR   Left highlight
307 \fBWA_LOW\fR    Low highlight
308 \fBWA_RIGHT\fR  Right highlight
309 \fBWA_TOP\fR    Top highlight
310 \fBWA_VERTICAL\fR       Vertical highlight
311 .TE
312 .RE
313 .PP
314 The return values of many of these routines are not meaningful (they are
315 implemented as macro-expanded assignments and simply return their argument).
316 The SVr4 manual page claims (falsely) that these routines always return \fB1\fR.
317 .\" ---------------------------------------------------------------------------
318 .SH NOTES
319 These functions may be macros:
320 .sp
321 .RS
322 \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR,
323 \fBattrset\fR, \fBwattrset\fR, \fBstandend\fR and \fBstandout\fR.
324 .RE
325 .PP
326 Color pair values can only be OR'd with attributes if the pair
327 number is less than 256.
328 The alternate functions such as \fBcolor_set\fP can pass a color pair
329 value directly.
330 However, ncurses ABI 4 and 5 simply OR this value 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 \fIYear\fR      \fISystem\fR    \fIArch\fP      \fIColor\fR     \fIChar\fR      \fINotes\fR
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 after 64-bit support was introduced in 1997,
437 but did not modify the SVr4 curses interface.
438 .PP
439 Regarding U/Win,
440 .bP
441 Development of the curses library began in 1991, stopped in 2000. 
442 .bP
443 Color support was added in 1998.
444 .bP
445 The library uses only \fBchtype\fP (no \fBcchar_t\fP).
446 .RE
447 .PP
448 Once X/Open curses was adopted in the mid-1990s, the constraint of
449 a 32-bit interface with many colors and wide-characters for \fBchtype\fP
450 became a moot point.  The \fBcchar_t\fP structure (whose size and
451 members are not specified in X/Open Curses) could be extended as needed.
452 .PP
453 Other interfaces are rarely used now:
454 .bP
455 BSD curses was improved slightly in 1993/1994 using Keith Bostic's
456 modification to make the library 8-bit clean for \fBnvi\fP.
457 He moved \fIstandout\fP attribute to a structure member.
458 .IP
459 The resulting 4.4BSD curses was replaced by ncurses over the next ten years.
460 .bP
461 U/Win is rarely used now.
462 .\" ---------------------------------------------------------------------------
463 .SH EXTENSIONS
464 .PP
465 This implementation provides the \fBA_ITALIC\fP attribute for terminals
466 which have the \fBenter_italics_mode\fP (\fBsitm\fP)
467 and \fBexit_italics_mode\fP (\fBritm\fP) capabilities.
468 Italics are not mentioned in X/Open Curses.
469 Unlike the other video attributes, \fBA_ITALIC\fP is unrelated
470 to the \fBset_attributes\fP capabilities.
471 This implementation makes the assumption that
472 \fBexit_attribute_mode\fP may also reset italics.
473 .PP
474 Each of the functions added by XSI Curses has a parameter \fIopts\fP,
475 which X/Open Curses still (after more than twenty years) documents
476 as reserved for future use, saying that it should be \fBNULL\fP.
477 This implementation uses that parameter in ABI 6 for the functions which
478 have a color-pair parameter to support \fIextended color pairs\fP:
479 .bP
480 For functions which modify the color, e.g.,
481 \fBwattr_set\fP,
482 if \fIopts\fP is set it is treated as a pointer to \fBint\fP,
483 and used to set the color pair instead of the \fBshort\fP \fIpair\fP parameter.
484 .bP
485 For functions which retrieve the color, e.g.,
486 \fBwattr_get\fP,
487 if \fIopts\fP is set it is treated as a pointer to \fBint\fP,
488 and used to retrieve the color pair as an \fBint\fP value,
489 in addition
490 retrieving it via the standard pointer to \fBshort\fP parameter.
491 .PP
492 The remaining functions which have \fIopts\fP,
493 but do not manipulate color,
494 e.g., \fBwattr_on\fP and \fBwattr_off\fP
495 are not used by this implementation except to check that they are \fBNULL\fP.
496 .\" ---------------------------------------------------------------------------
497 .SH PORTABILITY
498 These functions are supported in the XSI Curses standard, Issue 4.
499 The standard defined the dedicated type for highlights,
500 \fBattr_t\fR, which was not defined in SVr4 curses.
501 The functions taking \fBattr_t\fR arguments were not supported under SVr4.
502 .PP
503 Very old versions of this library did not force an update of the screen
504 when changing the attributes.
505 Use \fBtouchwin\fR to force the screen to match the updated attributes.
506 .PP
507 The XSI Curses standard states that whether the traditional functions
508 \fBattron\fR/\fBattroff\fR/\fBattrset\fR can manipulate attributes other than
509 \fBA_BLINK\fR, \fBA_BOLD\fR, \fBA_DIM\fR, \fBA_REVERSE\fR, \fBA_STANDOUT\fR, or
510 \fBA_UNDERLINE\fR is "unspecified".
511 Under this implementation as well as
512 SVr4 curses, these functions correctly manipulate all other highlights
513 (specifically, \fBA_ALTCHARSET\fR, \fBA_PROTECT\fR, and \fBA_INVIS\fR).
514 .PP
515 XSI Curses added these entry points:
516 .sp
517 .RS
518 \fBattr_get\fR, \fBattr_on\fR,
519 \fBattr_off\fR, \fBattr_set\fR, \fBwattr_on\fR, \fBwattr_off\fR,
520 \fBwattr_get\fR, \fBwattr_set\fR
521 .RE
522 .PP
523 The new functions are intended to work with
524 a new series of highlight macros prefixed with \fBWA_\fR.
525 The older macros have direct counterparts in the newer set of names:
526 .PP
527 .RS
528 .ne 9
529 .TS
530 l l
531 _ _ _
532 l l .
533 \fIName\fR      \fIDescription\fR
534 \fBWA_NORMAL\fR Normal display (no highlight)
535 \fBWA_STANDOUT\fR       Best highlighting mode of the terminal.
536 \fBWA_UNDERLINE\fR      Underlining
537 \fBWA_REVERSE\fR        Reverse video
538 \fBWA_BLINK\fR  Blinking
539 \fBWA_DIM\fR    Half bright
540 \fBWA_BOLD\fR   Extra bright or bold
541 \fBWA_ALTCHARSET\fR     Alternate character set
542 .TE
543 .RE
544 .PP
545 XSI curses does not assign values to these symbols,
546 nor does it state whether or not they are related to the
547 similarly-named A_NORMAL, etc.:
548 .bP
549 The XSI curses standard specifies that each pair of corresponding \fBA_\fR
550 and \fBWA_\fR-using functions operates on the same current-highlight
551 information.
552 .bP
553 However, in some implementations, those symbols have unrelated values.
554 .IP
555 For example, the Solaris \fIxpg4\fP (X/Open) curses declares
556 \fBattr_t\fP to be an unsigned short integer (16-bits),
557 while \fBchtype\fP is a unsigned integer (32-bits).
558 The \fBWA_\fP symbols in this case are different from the \fBA_\fP symbols
559 because they are used for a smaller datatype which does not
560 represent \fBA_CHARTEXT\fP or \fBA_COLOR\fP.
561 .IP
562 In this implementation (as in many others), the values happen to be
563 the same because it simplifies copying information between
564 \fBchtype\fP and \fBcchar_t\fP variables.
565 .PP
566 The XSI standard extended conformance level adds new highlights
567 \fBA_HORIZONTAL\fR, \fBA_LEFT\fR, \fBA_LOW\fR, \fBA_RIGHT\fR, \fBA_TOP\fR,
568 \fBA_VERTICAL\fR (and corresponding \fBWA_\fR macros for each).
569 As of August 2013,
570 no known terminal provides these highlights
571 (i.e., via the \fBsgr1\fP capability).
572 .\" ---------------------------------------------------------------------------
573 .SH RETURN VALUE
574 All routines return the integer \fBOK\fR on success, or \fBERR\fP on failure.
575 .PP
576 X/Open does not define any error conditions.
577 .PP
578 This implementation
579 .bP
580 returns an error if the window pointer is null.
581 .bP
582 returns an error if the color pair parameter
583 for \fBwcolor_set\fP is outside the range 0..COLOR_PAIRS\-1.
584 .bP
585 does not return an error if either of the parameters of \fBwattr_get\fP
586 used for retrieving attribute or color-pair values is \fBNULL\fP.
587 .PP
588 Functions with a "mv" prefix first perform a cursor movement using
589 \fBwmove\fP, and return an error if the position is outside the window,
590 or if the window pointer is null.
591 .\" ---------------------------------------------------------------------------
592 .SH SEE ALSO
593 .na
594 \fBcurses\fR(3X),
595 \fBcurs_addch\fR(3X),
596 \fBcurs_addstr\fR(3X),
597 \fBcurs_bkgd\fR(3X),
598 \fBcurs_printw\fR(3X),
599 \fBcurs_variables\fR(3X)