]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_attr.3x
d9568a5fc7d1e5f960c2283620d51f8b63fac01c
[ncurses.git] / man / curs_attr.3x
1 .\" $Id: curs_attr.3x,v 1.12 1997/01/05 01:14:33 tom Exp $
2 .TH curs_attr 3X ""
3 .SH NAME
4 \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR,
5 \fBattrset\fR, \fBwattrset\fR, \fBstandend\fR, \fBwstandend\fR, \fBstandout\fR,
6 \fBwstandout\fR - \fBcurses\fR character and window attribute control routines
7 .SH SYNOPSIS
8 \fB#include <curses.h>\fR
9 .br
10 \fBint attroff(int attrs);\fR
11 .br
12 \fBint wattroff(WINDOW *win, int attrs);\fR
13 .br
14 \fBint attron(int attrs);\fR
15 .br
16 \fBint wattron(WINDOW *win, int attrs);\fR
17 .br
18 \fBint attrset(int attrs);\fR
19 .br
20 \fBint wattrset(WINDOW *win, int attrs);\fR
21 .br
22 \fBint standend(void);\fR
23 .br
24 \fBint wstandend(WINDOW *win);\fR
25 .br
26 \fBint standout(void);\fR
27 .br
28 \fBint wstandout(WINDOW *win);\fR
29 .br
30 \fBattr_t attr_get(void);\fR
31 .br
32 \fBattr_t wattr_get(WINDOW *);\fR
33 .br
34 \fBint attr_off(attr_t attrs);\fR
35 .br
36 \fBint wattr_off(WINDOW *, attr_t attrs);\fR
37 .br
38 \fBint attr_on(attr_t attrs);\fR
39 .br
40 \fBint wattr_on(WINDOW *, attr_t attrs);\fR
41 .br
42 \fBint attr_set(attr_t attrs);\fR
43 .br
44 \fBint wattr_set(WINDOW *, attr_t attrs);\fR
45 .br
46 \fBint chgat(int n, attr_t attr, short color, const void *opts)\fR
47 .br
48 \fBint wchgat(WINDOW *, int n, attr_t attr,
49       short color, const void *opts)\fR
50 .br
51 \fBint mvchgat(int y, int x, int n, attr_t attr,
52       short color, const void *opts)\fR
53 .br
54 \fBint mvwchgat(WINDOW *, int y, int x, int n, attr_t attr,
55       short color, const void *opts)\fR
56 .br
57 .SH DESCRIPTION
58 These routines manipulate the current attributes of the named window.  The
59 current attributes of a window apply to all characters that are written into
60 the window with \fBwaddch\fR, \fBwaddstr\fR and \fBwprintw\fR.  Attributes are
61 a property of the character, and move with the character through any scrolling
62 and insert/delete line/character operations.  To the extent possible, they are
63 displayed as appropriate modifications to the graphic rendition of characters
64 put on the screen.
65
66 The routine \fBattrset\fR sets the current attributes of the given window to
67 \fIattrs\fR.  The routine \fBattroff\fR turns off the named attributes without
68 turning any other attributes on or off.  The routine \fBattron\fR turns on the
69 named attributes without affecting any others.  The routine \fBstandout\fR is
70 the same as \fBattron(A_STANDOUT)\fR.  The routine \fBstandend\fR is the same
71 as \fBattrset(A_NORMAL)\fR or \fBattrset(0)\fR, that is, it turns off all
72 attributes.
73
74 The routine \fBwattr_get\fR returns the current attribute for the given
75 window; \fBattr_get\fR returns the current attribute for \fBstdscr\fR.
76 The remaining \fBattr_\fR* functions operate exactly like the corresponding
77 \fBattr\fR* functions, except that they take arguments of type \fBattr_t\fR
78 rather than \fBint\fR.
79
80 The routine \fBchgat\fR changes the attributes of a given number of characters
81 starting at the current cursor location of \fBstdscr\fR.  It does not update
82 the cursor and does not perform wrapping.  A character count of -1 or greater
83 than the remaining window width means to change attributes all the way to the
84 end of the current line.  The \fBwchgat\fR function generalizes this to any
85 window; the \fBmvwchgat\fR function does a cursor move before acting.  In these
86 functions, the color argument is a color-pair index (as in the first argument
87 of \fIinit_pair\fR, see \fBcurs_color\fR(3x)).  The \fBopts\fR argument is not
88 presently used, but is reserved for the future (leave it \fBNULL\fR).
89 .SS Attributes
90 The following video attributes, defined in \fB<curses.h>\fR, can be passed to
91 the routines \fBattron\fR, \fBattroff\fR, and \fBattrset\fR, or OR'ed with the
92 characters passed to \fBaddch\fR.
93
94 .TS
95 center ;
96 l l .
97 \fBA_NORMAL\fR  Normal display (no highlight)
98 \fBA_STANDOUT\fR        Best highlighting mode of the terminal.
99 \fBA_UNDERLINE\fR       Underlining
100 \fBA_REVERSE\fR Reverse video
101 \fBA_BLINK\fR   Blinking
102 \fBA_DIM\fR     Half bright
103 \fBA_BOLD\fR    Extra bright or bold
104 \fBA_PROTECT\fR Protected mode
105 \fBA_INVIS\fR   Invisible or blank mode
106 \fBA_ALTCHARSET\fR      Alternate character set
107 \fBA_CHARTEXT\fR        Bit-mask to extract a character
108 \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR Color-pair number \fIn\fR
109 .TE
110
111 The following macro is the reverse of \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR:
112
113 .DS C
114 \fBPAIR_NUMBER(\fIattrs\fR) Returns the pair number associated
115                    with the \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR attribute.
116 .DE
117
118 The return values of many of these routines are not meaningful (they are
119 implemented as macro-expanded assignments and simply return their argument).
120 The SVr4 manual page claims (falsely) that these routines always return \fB1\fR.
121
122 .SH NOTES
123 Note that \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR,
124 \fBattrset\fR, \fBwattrset\fR, \fBstandend\fR and \fBstandout\fR may be macros.
125 .SH PORTABILITY
126 All these functions are supported in the XSI Curses standard, Issue 4.  The
127 standard defined the dedicated type for highlights, \fBattr_t\fR, which is not
128 defined in SVr4 curses. The functions taking \fBattr_t\fR arguments are
129 not supported under SVr4.
130
131 The XSI Curses standard states that whether the traditional functions
132 \fBattron\fR/\fBattroff\fR/\fBattrset\fR can manipulate attributes other than
133 \fBA_BLINK\fR, \fBA_BOLD\fR, \fBA_DIM\fR, \fBA_REVERSE\fR, \fBA_STANDOUT\fR, or
134 \fBA_UNDERLINE\fR is "unspecified".  Under this implementation as well as
135 SVr4 curses, these functions correctly manipulate all other highlights
136 (specifically, \fBA_ALTCHARSET\fR, \fBA_PROTECT\fR, and \fBA_INVIS\fR).
137
138 XSI Curses added the new entry points, \fBattr_get\fR, \fBattr_on\fR,
139 \fBattr_off\fR, \fBattr_set\fR, \fBwattr_on\fR, \fBwattr_off\fR,
140 \fBwattr_get\fR, \fBwattr_set\fR.  These are intended to work with
141 a new series of highlight macros prefixed with \fBWA_\fR.
142
143 .TS
144 center ;
145 l l .
146 \fBWA_NORMAL\fR Normal display (no highlight)
147 \fBWA_STANDOUT\fR       Best highlighting mode of the terminal.
148 \fBWA_UNDERLINE\fR      Underlining
149 \fBWA_REVERSE\fR        Reverse video
150 \fBWA_BLINK\fR  Blinking
151 \fBWA_DIM\fR    Half bright
152 \fBWA_BOLD\fR   Extra bright or bold
153 \fBWA_ALTCHARSET\fR     Alternate character set
154 .TE
155
156 The XSI curses standard specifies that each pair of corresponding \fBA_\fR
157 and \fBWA_\fR-using functions operates on the same current-highlight
158 information.
159
160 The XSI standard extended conformance level adds new highlights
161 \fBA_HORIZONTAL\fR, \fBA_LEFT\fR, \fBA_LOW\fR, \fBA_RIGHT\fR, \fBA_TOP\fR,
162 \fBA_VERTICAL\fR (and corresponding \fBWA_\fR macros for each) which this
163 curses does not yet support.
164 .SH SEE ALSO
165 \fBcurses\fR(3X), \fBcurs_addch\fR(3X), \fBcurs_addstr\fR(3X),
166 \fBcurs_printw\fR(3X)
167 .\"#
168 .\"# The following sets edit modes for GNU EMACS
169 .\"# Local Variables:
170 .\"# mode:nroff
171 .\"# fill-column:79
172 .\"# End: