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