Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | '\" t |
| 2 | .\"*************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 3 | .\" Copyright (c) 1998-2013,2015 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | .\" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 30 | .\" $Id: curs_attr.3x,v 1.40 2015/07/20 23:35:38 tom Exp $ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 31 | .TH curs_attr 3X "" |
| 32 | .na |
| 33 | .hy 0 |
| 34 | .SH NAME |
| 35 | \fBattroff\fR, |
| 36 | \fBwattroff\fR, |
| 37 | \fBattron\fR, |
| 38 | \fBwattron\fR, |
| 39 | \fBattrset\fR, |
| 40 | \fBwattrset\fR, |
| 41 | \fBcolor_set\fR, |
| 42 | \fBwcolor_set\fR, |
| 43 | \fBstandend\fR, |
| 44 | \fBwstandend\fR, |
| 45 | \fBstandout\fR, |
| 46 | \fBwstandout\fR, |
| 47 | \fBattr_get\fR, |
| 48 | \fBwattr_get\fR, |
| 49 | \fBattr_off\fR, |
| 50 | \fBwattr_off\fR, |
| 51 | \fBattr_on\fR, |
| 52 | \fBwattr_on\fR, |
| 53 | \fBattr_set\fR, |
| 54 | \fBwattr_set\fR, |
| 55 | \fBchgat\fR, |
| 56 | \fBwchgat\fR, |
| 57 | \fBmvchgat\fR, |
| 58 | \fBmvwchgat\fR, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 59 | \fBPAIR_NUMBER\fR \- \fBcurses\fR character and window attribute control routines |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 60 | .ad |
| 61 | .hy |
| 62 | .SH SYNOPSIS |
| 63 | \fB#include <curses.h>\fR |
| 64 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 65 | \fBint attroff(int \fP\fIattrs);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 66 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 67 | \fBint wattroff(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 68 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 69 | \fBint attron(int \fP\fIattrs\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 70 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 71 | \fBint wattron(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 72 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 73 | \fBint attrset(int \fP\fIattrs\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 74 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 75 | \fBint wattrset(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 76 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 77 | \fBint color_set(short \fP\fIcolor_pair_number\fP\fB, void* \fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 78 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 79 | \fBint wcolor_set(WINDOW *\fP\fIwin\fP\fB, short \fP\fIcolor_pair_number\fP\fB,\fR |
| 80 | \fBvoid* \fP\fIopts);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 81 | .br |
| 82 | \fBint standend(void);\fR |
| 83 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 84 | \fBint wstandend(WINDOW *\fP\fIwin\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 85 | .br |
| 86 | \fBint standout(void);\fR |
| 87 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 88 | \fBint wstandout(WINDOW *\fP\fIwin\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 89 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 90 | \fBint attr_get(attr_t *\fP\fIattrs\fP\fB, short *\fP\fIpair\fP\fB, void *\fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 91 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 92 | \fBint wattr_get(WINDOW *\fP\fIwin\fP\fB, attr_t *\fP\fIattrs\fP\fB, short *\fP\fIpair\fP\fB,\fR |
| 93 | \fBvoid *\fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 94 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 95 | \fBint attr_off(attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 96 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 97 | \fBint wattr_off(WINDOW *\fP\fIwin\fP\fB, attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 98 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 99 | \fBint attr_on(attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 100 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 101 | \fBint wattr_on(WINDOW *\fP\fIwin\fP\fB, attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 102 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 103 | \fBint attr_set(attr_t \fP\fIattrs\fP\fB, short \fP\fIpair\fP\fB, void *\fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 104 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 105 | \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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 106 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 107 | \fBint chgat(int \fP\fIn\fP\fB, attr_t \fP\fIattr\fP\fB, short \fP\fIcolor\fP\fB,\fR |
| 108 | \fBconst void *\fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 109 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 110 | \fBint wchgat(WINDOW *\fP\fIwin\fP\fB, int \fP\fIn\fP\fB, attr_t \fP\fIattr\fP\fB,\fR |
| 111 | \fBshort \fP\fIcolor\fP\fB, const void *\fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 112 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 113 | \fBint mvchgat(int \fP\fIy\fP\fB, int \fP\fIx\fP\fB, int \fP\fIn\fP\fB, attr_t \fP\fIattr\fP\fB,\fR |
| 114 | \fBshort \fP\fIcolor\fP\fB, const void *\fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 115 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 116 | \fBint mvwchgat(WINDOW *\fP\fIwin, int \fP\fIy, int \fP\fIx, int \fP\fIn,\fR |
| 117 | \fBattr_t \fP\fIattr\fP\fB, short \fP\fIcolor\fP\fB, const void *\fP\fIopts\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 118 | .br |
| 119 | .SH DESCRIPTION |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 120 | These routines manipulate the current attributes of the named window. |
| 121 | The |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 122 | current attributes of a window apply to all characters that are written into |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 123 | the window with \fBwaddch\fR, \fBwaddstr\fR and \fBwprintw\fR. |
| 124 | Attributes are |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 125 | a property of the character, and move with the character through any scrolling |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 126 | and insert/delete line/character operations. |
| 127 | To the extent possible, they are |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 128 | displayed as appropriate modifications to the graphic rendition of characters |
| 129 | put on the screen. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 130 | .SS attrset |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 131 | .PP |
| 132 | The routine \fBattrset\fR sets the current attributes of the given window to |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 133 | \fIattrs\fR. |
| 134 | The routine \fBattroff\fR turns off the named attributes without |
| 135 | turning any other attributes on or off. |
| 136 | The routine \fBattron\fR turns on the |
| 137 | named attributes without affecting any others. |
| 138 | The routine \fBstandout\fR is |
| 139 | the same as \fBattron(A_STANDOUT)\fR. |
| 140 | The routine \fBstandend\fR is the same |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 141 | as \fBattrset(A_NORMAL)\fR or \fBattrset(0)\fR, that is, it turns off all |
| 142 | attributes. |
| 143 | .PP |
| 144 | The \fBattrset\fR and related routines do not affect the attributes used |
| 145 | when erasing portions of the window. |
| 146 | See \fBcurs_bkgd\fR(3X) for functions which modify the attributes used for |
| 147 | erasing and clearing. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 148 | .SS attr_set |
| 149 | The \fBattrset\fP routine is actually a legacy feature predating SVr4 curses |
| 150 | but kept in X/Open Curses for the same reason that SVr4 curses kept it: |
| 151 | compatbility. |
| 152 | The routine \fBattr_set\fP provides for passing a color-pair parameter. |
| 153 | .PP |
| 154 | The remaining \fBattr_\fR* functions operate exactly like the corresponding |
| 155 | \fBattr\fR* functions, except that they take arguments of type \fBattr_t\fR |
| 156 | rather than \fBint\fR. |
| 157 | .SS color_set |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 158 | .PP |
| 159 | The routine \fBcolor_set\fR sets the current color of the given window to the |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 160 | foreground/background combination described by the color_pair_number. |
| 161 | The |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 162 | parameter opts is reserved for future use, applications must supply a null |
| 163 | pointer. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 164 | .SS attr_get |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 165 | .PP |
| 166 | The routine \fBwattr_get\fR returns the current attribute and color pair for |
| 167 | the given window; \fBattr_get\fR returns the current attribute and color pair |
| 168 | for \fBstdscr\fR. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 169 | .PP |
| 170 | There is no corresponding \fBattrget\fP function as such in X/Open Curses, |
| 171 | although ncurses provides \fBgetattrs\fP (see curs_legacy(3x)). |
| 172 | .SS chgat |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 173 | .PP |
| 174 | The routine \fBchgat\fR changes the attributes of a given number of characters |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 175 | starting at the current cursor location of \fBstdscr\fR. |
| 176 | It does not update |
| 177 | the cursor and does not perform wrapping. |
| 178 | A character count of \-1 or greater |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 179 | than the remaining window width means to change attributes all the way to the |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 180 | end of the current line. |
| 181 | The \fBwchgat\fR function generalizes this to any |
| 182 | window; the \fBmvwchgat\fR function does a cursor move before acting. |
| 183 | In these |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 184 | functions, the color argument is a color-pair index (as in the first argument |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 185 | of \fIinit_pair\fR, see \fBcurs_color\fR(3X)). |
| 186 | The \fBopts\fR argument is not |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 187 | presently used, but is reserved for the future (leave it \fBNULL\fR). |
| 188 | .SS Attributes |
| 189 | The following video attributes, defined in \fB<curses.h>\fR, can be passed to |
| 190 | the routines \fBattron\fR, \fBattroff\fR, and \fBattrset\fR, or OR'd with the |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 191 | characters passed to \fBaddch\fR (see curs_addch(3x)). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 192 | .PP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 193 | .RS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 194 | .TS |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 195 | l l |
| 196 | _ _ _ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 197 | l l . |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 198 | \fIName\fR \fIDescription\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 199 | \fBA_NORMAL\fR Normal display (no highlight) |
| 200 | \fBA_STANDOUT\fR Best highlighting mode of the terminal. |
| 201 | \fBA_UNDERLINE\fR Underlining |
| 202 | \fBA_REVERSE\fR Reverse video |
| 203 | \fBA_BLINK\fR Blinking |
| 204 | \fBA_DIM\fR Half bright |
| 205 | \fBA_BOLD\fR Extra bright or bold |
| 206 | \fBA_PROTECT\fR Protected mode |
| 207 | \fBA_INVIS\fR Invisible or blank mode |
| 208 | \fBA_ALTCHARSET\fR Alternate character set |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 209 | \fBA_ITALIC\fR Italics (non-X/Open extension) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 210 | \fBA_CHARTEXT\fR Bit-mask to extract a character |
| 211 | \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR Color-pair number \fIn\fR |
| 212 | .TE |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 213 | .RE |
| 214 | .PP |
| 215 | These video attributes are supported by \fBattr_on\fP and related functions |
| 216 | (which also support the attributes recognized by \fBattron\fP, etc.): |
| 217 | .RS |
| 218 | .TS |
| 219 | l l |
| 220 | _ _ _ |
| 221 | l l . |
| 222 | \fIName\fR \fIDescription\fR |
| 223 | \fBWA_HORIZONTAL\fR Horizontal highlight |
| 224 | \fBWA_LEFT\fR Left highlight |
| 225 | \fBWA_LOW\fR Low highlight |
| 226 | \fBWA_RIGHT\fR Right highlight |
| 227 | \fBWA_TOP\fR Top highlight |
| 228 | \fBWA_VERTICAL\fR Vertical highlight |
| 229 | .TE |
| 230 | .RE |
| 231 | .PP |
| 232 | For consistency |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 233 | .PP |
| 234 | The following macro is the reverse of \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR: |
| 235 | .PP |
| 236 | .br |
| 237 | \fBPAIR_NUMBER(\fR\fIattrs\fR) Returns the pair number associated |
| 238 | with the \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR attribute. |
| 239 | .br |
| 240 | .PP |
| 241 | The return values of many of these routines are not meaningful (they are |
| 242 | implemented as macro-expanded assignments and simply return their argument). |
| 243 | The SVr4 manual page claims (falsely) that these routines always return \fB1\fR. |
| 244 | .SH NOTES |
| 245 | Note that \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR, |
| 246 | \fBattrset\fR, \fBwattrset\fR, \fBstandend\fR and \fBstandout\fR may be macros. |
| 247 | .PP |
| 248 | \fBCOLOR_PAIR\fP values can only be OR'd with attributes if the pair |
| 249 | number is less than 256. |
| 250 | The alternate functions such as \fBcolor_set\fP can pass a color pair |
| 251 | value directly. |
| 252 | However, ncurses ABI 4 and 5 simply OR this value within the alternate functions. |
| 253 | You must use ncurses ABI 6 to support more than 256 color pairs. |
| 254 | .SH PORTABILITY |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 255 | These functions are supported in the XSI Curses standard, Issue 4. |
| 256 | The |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 257 | standard defined the dedicated type for highlights, \fBattr_t\fR, which is not |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 258 | defined in SVr4 curses. |
| 259 | The functions taking \fBattr_t\fR arguments are |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 260 | not supported under SVr4. |
| 261 | .PP |
| 262 | The XSI Curses standard states that whether the traditional functions |
| 263 | \fBattron\fR/\fBattroff\fR/\fBattrset\fR can manipulate attributes other than |
| 264 | \fBA_BLINK\fR, \fBA_BOLD\fR, \fBA_DIM\fR, \fBA_REVERSE\fR, \fBA_STANDOUT\fR, or |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 265 | \fBA_UNDERLINE\fR is "unspecified". |
| 266 | Under this implementation as well as |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 267 | SVr4 curses, these functions correctly manipulate all other highlights |
| 268 | (specifically, \fBA_ALTCHARSET\fR, \fBA_PROTECT\fR, and \fBA_INVIS\fR). |
| 269 | .PP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 270 | This implementation provides the \fBA_ITALIC\fP attribute for terminals |
| 271 | which have the \fIenter_italics_mode\fP (sitm) and \fIexit_italics_mode\fP (ritm) capabilities. |
| 272 | Italics are not mentioned in X/Open Curses. |
| 273 | Unlike the other video attributes, \fBI_ITALIC\fP is unrelated |
| 274 | to the \fIset_attributes\fP capabilities. |
| 275 | This implementation makes the assumption that |
| 276 | \fIexit_attribute_mode\fP may also reset italics. |
| 277 | .PP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 278 | XSI Curses added the new entry points, \fBattr_get\fR, \fBattr_on\fR, |
| 279 | \fBattr_off\fR, \fBattr_set\fR, \fBwattr_on\fR, \fBwattr_off\fR, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 280 | \fBwattr_get\fR, \fBwattr_set\fR. |
| 281 | These are intended to work with |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 282 | a new series of highlight macros prefixed with \fBWA_\fR. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 283 | The older macros have direct counterparts in the newer set of names: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 284 | .PP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 285 | .RS |
| 286 | .ne 9 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 287 | .TS |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 288 | l l |
| 289 | _ _ _ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 290 | l l . |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 291 | \fIName\fR \fIDescription\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 292 | \fBWA_NORMAL\fR Normal display (no highlight) |
| 293 | \fBWA_STANDOUT\fR Best highlighting mode of the terminal. |
| 294 | \fBWA_UNDERLINE\fR Underlining |
| 295 | \fBWA_REVERSE\fR Reverse video |
| 296 | \fBWA_BLINK\fR Blinking |
| 297 | \fBWA_DIM\fR Half bright |
| 298 | \fBWA_BOLD\fR Extra bright or bold |
| 299 | \fBWA_ALTCHARSET\fR Alternate character set |
| 300 | .TE |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 301 | .RE |
| 302 | .PP |
| 303 | Very old versions of this library did not force an update of the screen |
| 304 | when changing the attributes. |
| 305 | Use \fBtouchwin\fR to force the screen to match the updated attributes. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 306 | .PP |
| 307 | The XSI curses standard specifies that each pair of corresponding \fBA_\fR |
| 308 | and \fBWA_\fR-using functions operates on the same current-highlight |
| 309 | information. |
| 310 | .PP |
| 311 | The XSI standard extended conformance level adds new highlights |
| 312 | \fBA_HORIZONTAL\fR, \fBA_LEFT\fR, \fBA_LOW\fR, \fBA_RIGHT\fR, \fBA_TOP\fR, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 313 | \fBA_VERTICAL\fR (and corresponding \fBWA_\fR macros for each). |
| 314 | As of August 2013, |
| 315 | no known terminal provides these highlights |
| 316 | (i.e., via the \fBsgr1\fP capability). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 317 | .SH RETURN VALUE |
| 318 | All routines return the integer \fBOK\fR on success, or \fBERR\fP on failure. |
| 319 | .PP |
| 320 | X/Open does not define any error conditions. |
| 321 | .PP |
| 322 | This implementation returns an error |
| 323 | if the window pointer is null. |
| 324 | The \fBwcolor_set\fP function returns an error if the color pair parameter |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 325 | is outside the range 0..COLOR_PAIRS\-1. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 326 | This implementation also provides |
| 327 | \fBgetattrs\fR |
| 328 | for compatibility with older versions of curses. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 329 | .PP |
| 330 | Functions with a "mv" prefix first perform a cursor movement using |
| 331 | \fBwmove\fP, and return an error if the position is outside the window, |
| 332 | or if the window pointer is null. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 333 | .SH SEE ALSO |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 334 | .na |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 335 | \fBcurses\fR(3X), |
| 336 | \fBcurs_addch\fR(3X), |
| 337 | \fBcurs_addstr\fR(3X), |
| 338 | \fBcurs_bkgd\fR(3X), |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 339 | \fBcurs_printw\fR(3X), |
| 340 | \fBcurs_variables\fR(3X) |