Merge from vendor branch OPENSSH:
[dragonfly.git] / lib / libncurses / man / curs_attr.3
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998-2002,2003 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.27 2003/12/27 18:50:51 tom Exp $
31 .\" $DragonFly: src/lib/libncurses/man/curs_attr.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
32 .TH curs_attr 3X ""
33 .SH NAME
34 \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR,
35 \fBattrset\fR, \fBwattrset\fR, \fBcolor_set\fR, \fBwcolor_set\fR,
36 \fBstandend\fR, \fBwstandend\fR, \fBstandout\fR, \fBwstandout\fR,
37 \fBattr_get\fR, \fBwattr_get\fR,
38 \fBattr_off\fR, \fBwattr_off\fR,
39 \fBattr_on\fR, \fBwattr_on\fR,
40 \fBattr_set\fR, \fBwattr_set\fR,
41 \fBchgat\fR, \fBwchgat\fR,
42 \fBmvchgat\fR, \fBmvwchgat\fR,
43 \fBPAIR_NUMBER\fR - \fBcurses\fR character and window attribute control routines
44 .SH SYNOPSIS
45 \fB#include <curses.h>\fR
46 .br
47 \fBint attroff(int attrs);\fR
48 .br
49 \fBint wattroff(WINDOW *win, int attrs);\fR
50 .br
51 \fBint attron(int attrs);\fR
52 .br
53 \fBint wattron(WINDOW *win, int attrs);\fR
54 .br
55 \fBint attrset(int attrs);\fR
56 .br
57 \fBint wattrset(WINDOW *win, int attrs);\fR
58 .br
59 \fBint color_set(short color_pair_number, void* opts);\fR
60 .br
61 \fBint wcolor_set(WINDOW *win, short color_pair_number,\fR
62       \fBvoid* opts);\fR
63 .br
64 \fBint standend(void);\fR
65 .br
66 \fBint wstandend(WINDOW *win);\fR
67 .br
68 \fBint standout(void);\fR
69 .br
70 \fBint wstandout(WINDOW *win);\fR
71 .br
72 \fBint attr_get(attr_t *attrs, short *pair, void *opts);\fR
73 .br
74 \fBint wattr_get(WINDOW *win, attr_t *attrs, short *pair,\fR
75        \fBvoid *opts);\fR
76 .br
77 \fBint attr_off(attr_t attrs, void *opts);\fR
78 .br
79 \fBint wattr_off(WINDOW *win, attr_t attrs, void *opts);\fR
80 .br
81 \fBint attr_on(attr_t attrs, void *opts);\fR
82 .br
83 \fBint wattr_on(WINDOW *win, attr_t attrs, void *opts);\fR
84 .br
85 \fBint attr_set(attr_t attrs, short pair, void *opts);\fR
86 .br
87 \fBint wattr_set(WINDOW *win, attr_t attrs, short pair, void *opts);\fR
88 .br
89 \fBint chgat(int n, attr_t attr, short color,\fR
90       \fBconst void *opts)\fR
91 .br
92 \fBint wchgat(WINDOW *win, int n, attr_t attr,\fR
93       \fBshort color, const void *opts)\fR
94 .br
95 \fBint mvchgat(int y, int x, int n, attr_t attr,\fR
96       \fBshort color, const void *opts)\fR
97 .br
98 \fBint mvwchgat(WINDOW *win, int y, int x, int n,\fR
99       \fBattr_t attr, short color, const void *opts)\fR
100 .br
101 .SH DESCRIPTION
102 These routines manipulate the current attributes of the named window.  The
103 current attributes of a window apply to all characters that are written into
104 the window with \fBwaddch\fR, \fBwaddstr\fR and \fBwprintw\fR.  Attributes are
105 a property of the character, and move with the character through any scrolling
106 and insert/delete line/character operations.  To the extent possible, they are
107 displayed as appropriate modifications to the graphic rendition of characters
108 put on the screen.
109 .PP
110 The routine \fBattrset\fR sets the current attributes of the given window to
111 \fIattrs\fR.  The routine \fBattroff\fR turns off the named attributes without
112 turning any other attributes on or off.  The routine \fBattron\fR turns on the
113 named attributes without affecting any others.  The routine \fBstandout\fR is
114 the same as \fBattron(A_STANDOUT)\fR.  The routine \fBstandend\fR is the same
115 as \fBattrset(A_NORMAL)\fR or \fBattrset(0)\fR, that is, it turns off all
116 attributes.
117 .PP
118 The \fBattrset\fR and related routines do not affect the attributes used
119 when erasing portions of the window.
120 See \fBcurs_bkgd\fR(3X) for functions which modify the attributes used for
121 erasing and clearing.
122 .PP
123 The routine \fBcolor_set\fR sets the current color of the given window to the
124 foreground/background combination described by the color_pair_number. The
125 parameter opts is reserved for future use, applications must supply a null
126 pointer.
127 .PP
128 The routine \fBwattr_get\fR returns the current attribute and color pair for
129 the given window; \fBattr_get\fR returns the current attribute and color pair
130 for \fBstdscr\fR.
131 The remaining \fBattr_\fR* functions operate exactly like the corresponding
132 \fBattr\fR* functions, except that they take arguments of type \fBattr_t\fR
133 rather than \fBint\fR.
134 .PP
135 The routine \fBchgat\fR changes the attributes of a given number of characters
136 starting at the current cursor location of \fBstdscr\fR.  It does not update
137 the cursor and does not perform wrapping.  A character count of -1 or greater
138 than the remaining window width means to change attributes all the way to the
139 end of the current line.  The \fBwchgat\fR function generalizes this to any
140 window; the \fBmvwchgat\fR function does a cursor move before acting.  In these
141 functions, the color argument is a color-pair index (as in the first argument
142 of \fIinit_pair\fR, see \fBcurs_color\fR(3X)).  The \fBopts\fR argument is not
143 presently used, but is reserved for the future (leave it \fBNULL\fR).
144 Note that changing the attributes does not imply
145 that a subsequent \fBrefresh\fR will update the screen to match,
146 since the character values are not modified.
147 Use \fBtouchwin\fR to force the screen to match the updated attributes.
148 .SS Attributes
149 The following video attributes, defined in \fB<curses.h>\fR, can be passed to
150 the routines \fBattron\fR, \fBattroff\fR, and \fBattrset\fR, or OR'ed with the
151 characters passed to \fBaddch\fR.
152 .PP
153 .TS
154 center ;
155 l l .
156 \fBA_NORMAL\fR  Normal display (no highlight)
157 \fBA_STANDOUT\fR        Best highlighting mode of the terminal.
158 \fBA_UNDERLINE\fR       Underlining
159 \fBA_REVERSE\fR Reverse video
160 \fBA_BLINK\fR   Blinking
161 \fBA_DIM\fR     Half bright
162 \fBA_BOLD\fR    Extra bright or bold
163 \fBA_PROTECT\fR Protected mode
164 \fBA_INVIS\fR   Invisible or blank mode
165 \fBA_ALTCHARSET\fR      Alternate character set
166 \fBA_CHARTEXT\fR        Bit-mask to extract a character
167 \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR Color-pair number \fIn\fR
168 .TE
169 .PP
170 The following macro is the reverse of \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR:
171 .PP
172 .br
173 \fBPAIR_NUMBER(\fR\fIattrs\fR) Returns the pair number associated
174                    with the \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR attribute.
175 .br
176 .PP
177 The return values of many of these routines are not meaningful (they are
178 implemented as macro-expanded assignments and simply return their argument).
179 The SVr4 manual page claims (falsely) that these routines always return \fB1\fR.
180 .SH NOTES
181 Note that \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR,
182 \fBattrset\fR, \fBwattrset\fR, \fBstandend\fR and \fBstandout\fR may be macros.
183 .SH PORTABILITY
184 All these functions are supported in the XSI Curses standard, Issue 4.  The
185 standard defined the dedicated type for highlights, \fBattr_t\fR, which is not
186 defined in SVr4 curses. The functions taking \fBattr_t\fR arguments are
187 not supported under SVr4.
188 .PP
189 The XSI Curses standard states that whether the traditional functions
190 \fBattron\fR/\fBattroff\fR/\fBattrset\fR can manipulate attributes other than
191 \fBA_BLINK\fR, \fBA_BOLD\fR, \fBA_DIM\fR, \fBA_REVERSE\fR, \fBA_STANDOUT\fR, or
192 \fBA_UNDERLINE\fR is "unspecified".  Under this implementation as well as
193 SVr4 curses, these functions correctly manipulate all other highlights
194 (specifically, \fBA_ALTCHARSET\fR, \fBA_PROTECT\fR, and \fBA_INVIS\fR).
195 .PP
196 XSI Curses added the new entry points, \fBattr_get\fR, \fBattr_on\fR,
197 \fBattr_off\fR, \fBattr_set\fR, \fBwattr_on\fR, \fBwattr_off\fR,
198 \fBwattr_get\fR, \fBwattr_set\fR.  These are intended to work with
199 a new series of highlight macros prefixed with \fBWA_\fR.
200 .PP
201 .TS
202 center ;
203 l l .
204 \fBWA_NORMAL\fR Normal display (no highlight)
205 \fBWA_STANDOUT\fR       Best highlighting mode of the terminal.
206 \fBWA_UNDERLINE\fR      Underlining
207 \fBWA_REVERSE\fR        Reverse video
208 \fBWA_BLINK\fR  Blinking
209 \fBWA_DIM\fR    Half bright
210 \fBWA_BOLD\fR   Extra bright or bold
211 \fBWA_ALTCHARSET\fR     Alternate character set
212 .TE
213 .PP
214 The XSI curses standard specifies that each pair of corresponding \fBA_\fR
215 and \fBWA_\fR-using functions operates on the same current-highlight
216 information.
217 .PP
218 The XSI standard extended conformance level adds new highlights
219 \fBA_HORIZONTAL\fR, \fBA_LEFT\fR, \fBA_LOW\fR, \fBA_RIGHT\fR, \fBA_TOP\fR,
220 \fBA_VERTICAL\fR (and corresponding \fBWA_\fR macros for each) which this
221 curses does not yet support.
222 .SH SEE ALSO
223 \fBcurses\fR(3X),
224 \fBcurs_addch\fR(3X),
225 \fBcurs_addstr\fR(3X),
226 \fBcurs_bkgd\fR(3X),
227 \fBcurs_printw\fR(3X)
228 .\"#
229 .\"# The following sets edit modes for GNU EMACS
230 .\"# Local Variables:
231 .\"# mode:nroff
232 .\"# fill-column:79
233 .\"# End: