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