1 .\" $NetBSD: curses_attributes.3,v 1.8 2008/04/30 13:10:51 martin Exp $
2 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
3 .\" All rights reserved.
5 .\" This code is derived from software contributed to The NetBSD Foundation
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 .\" POSSIBILITY OF SUCH DAMAGE.
29 .Dt CURSES_ATTRIBUTES 3
32 .Nm curses_attributes ,
52 .Nd curses general attribute manipulation routines
60 .Fn attroff "int attr"
62 .Fn attrset "int attr"
64 .Fn color_set "short pair" "void *opt"
66 .Fn getattrs "WINDOW *win"
70 .Fn wcolor_set "WINDOW *win" "short pair" "void *opt"
72 .Fn wattron "WINDOW * win" "int attr"
74 .Fn wattroff "WINDOW * win" "int attr"
76 .Fn wattrset "WINDOW * win" "int attr"
78 .Fn attr_on "attr_t attr" "void *opt"
80 .Fn attr_off "attr_t attr" "void *opt"
82 .Fn attr_set "attr_t attr" "short pair" "void *opt"
84 .Fn attr_get "attr_t *attr" "short *pair" "void *opt"
88 .Fn wattr_on "WINDOW *win" "attr_t attr" "void *opt"
90 .Fn wattr_off "WINDOW *win" "attr_t attr" "void *opt"
92 .Fn wattr_set "WINDOW *win" "attr_t attr" "short pair" "void *opt"
94 .Fn wattr_get "WINDOW *win" "attr_t *attr" "short *pair" "void *opt"
96 These functions manipulate attributes on
98 or on the specified window.
99 The attributes that can be manipulated are:
101 .Bl -tag -width "COLOR_PAIR(n)" -compact -offset indent
103 no special attributes are applied
105 characters are displayed in standout mode
107 characters are displayed underlined
109 characters are displayed in inverse video
113 characters are displayed at a lower intensity
115 characters are displayed at a higher intensity
117 characters are added invisibly
119 characters are protected from modification
121 characters are displayed using the alternate character set (ACS)
123 characters are displayed using color pair n.
128 function turns on the attributes specified in
134 function turns off the attributes specified in
141 sets the attributes of
143 to those specified in
145 turning off any others.
146 To turn off all the attributes (including color and alternate character set),
148 .Fn attrset A_NORMAL .
150 Multiple attributes can be manipulated by combining the attributes
154 .Fn attron "A_REVERSE | A_BOLD"
155 will turn on both inverse video and higher intensity.
159 sets the color pair attribute to the pair specified in
164 returns the attributes that are currently applied to window specified by
171 of attributes that can be applied to the screen.
185 respectively, excepting that the attributes are applied to the window
189 The following functions additionally manipulate wide attributes on
191 or on the specified window.
192 The additional wide attributes that can be manipulated are:
194 .Bl -tag -width "COLOR_PAIR(n)" -compact -offset indent
196 characters are displayed in standout mode
198 characters are displayed underlined
200 characters are displayed in inverse video
204 characters are displayed at a lower intensity
206 characters are displayed at a higher intensity
208 characters are added invisibly
210 characters are protected from modification
212 characters are displayed using the alternate character set (ACS)
214 characters are displayed with low highlight
216 characters are displayed with top highlight
218 characters are displayed with horizontal highlight
220 characters are displayed with vertical highlight
222 characters are displayed with left highlight
224 characters are displayed with right highlight
229 function turns on the wide attributes specified in
235 function turns off the wide attributes specified in
242 sets the wide attributes of
244 to those specified in
248 turning off any others.
249 Note that a color pair specified in
251 will override any color pair specified in
258 to the wide attributes and
260 to the color pair currently applied to
268 if the relevant value is of no interest.
274 of wide attributes that can be applied to the screen.
286 respectively, excepting that the character is added to the window specified by
293 excepting that the wide attributes and color pair currently applied to
297 The following constants can be used to extract the components of a
300 .Bl -tag -width "COLOR_PAIR(n)" -compact -offset indent
302 bit-mask containing attributes part
304 bit-mask containing character part
306 bit-mask containing color-pair part
309 These functions return OK on success and ERR on failure.
312 .Xr curses_addchstr 3 ,
313 .Xr curses_addstr 3 ,
314 .Xr curses_background 3 ,
316 .Xr curses_insertch 3 ,
317 .Xr curses_standout 3 ,
318 .Xr curses_underscore 3
322 argument is not currently used but is reserved for a future version of the
327 Curses library complies with the X/Open Curses specification, part of the
328 Single Unix Specification.
337 These functions first appeared in
340 Some terminals do not support characters with both color and other attributes
342 In this case, the other attribute is displayed instead of the color attribute.