Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | <!-- |
| 2 | * t |
| 3 | **************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 4 | * Copyright (c) 1998-2013,2015 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 5 | * * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a * |
| 7 | * copy of this software and associated documentation files (the * |
| 8 | * "Software"), to deal in the Software without restriction, including * |
| 9 | * without limitation the rights to use, copy, modify, merge, publish, * |
| 10 | * distribute, distribute with modifications, sublicense, and/or sell * |
| 11 | * copies of the Software, and to permit persons to whom the Software is * |
| 12 | * furnished to do so, subject to the following conditions: * |
| 13 | * * |
| 14 | * The above copyright notice and this permission notice shall be included * |
| 15 | * in all copies or substantial portions of the Software. * |
| 16 | * * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 20 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 21 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 22 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 23 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 24 | * * |
| 25 | * Except as contained in this notice, the name(s) of the above copyright * |
| 26 | * holders shall not be used in advertising or otherwise to promote the * |
| 27 | * sale, use or other dealings in this Software without prior written * |
| 28 | * authorization. * |
| 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 | --> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 32 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 33 | <HTML> |
| 34 | <HEAD> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 35 | <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
| 36 | <meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts"> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 37 | <TITLE>curs_attr 3x</TITLE> |
| 38 | <link rev=made href="mailto:bug-ncurses@gnu.org"> |
| 39 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 40 | </HEAD> |
| 41 | <BODY> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 42 | <H1 class="no-header">curs_attr 3x</H1> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 43 | <PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 44 | <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG> <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG> |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 50 | <H2><a name="h2-NAME">NAME</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 51 | <STRONG>attroff</STRONG>, <STRONG>wattroff</STRONG>, <STRONG>attron</STRONG>, <STRONG>wattron</STRONG>, <STRONG>attrset</STRONG>, <STRONG>wattrset</STRONG>, |
| 52 | <STRONG>color_set</STRONG>, <STRONG>wcolor_set</STRONG>, <STRONG>standend</STRONG>, <STRONG>wstandend</STRONG>, <STRONG>standout</STRONG>, |
| 53 | <STRONG>wstandout</STRONG>, <STRONG>attr_get</STRONG>, <STRONG>wattr_get</STRONG>, <STRONG>attr_off</STRONG>, <STRONG>wattr_off</STRONG>, |
| 54 | <STRONG>attr_on</STRONG>, <STRONG>wattr_on</STRONG>, <STRONG>attr_set</STRONG>, <STRONG>wattr_set</STRONG>, <STRONG>chgat</STRONG>, <STRONG>wchgat</STRONG>, |
| 55 | <STRONG>mvchgat</STRONG>, <STRONG>mvwchgat</STRONG>, <STRONG>PAIR_NUMBER</STRONG> - <STRONG>curses</STRONG> character and |
| 56 | window attribute control routines |
| 57 | |
| 58 | |
| 59 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 60 | <H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 61 | <STRONG>#include</STRONG> <STRONG><curses.h></STRONG> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 62 | <STRONG>int</STRONG> <STRONG>attroff(int</STRONG> <EM>attrs);</EM> |
| 63 | <STRONG>int</STRONG> <STRONG>wattroff(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>attrs</EM><STRONG>);</STRONG> |
| 64 | <STRONG>int</STRONG> <STRONG>attron(int</STRONG> <EM>attrs</EM><STRONG>);</STRONG> |
| 65 | <STRONG>int</STRONG> <STRONG>wattron(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>attrs</EM><STRONG>);</STRONG> |
| 66 | <STRONG>int</STRONG> <STRONG>attrset(int</STRONG> <EM>attrs</EM><STRONG>);</STRONG> |
| 67 | <STRONG>int</STRONG> <STRONG>wattrset(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>attrs</EM><STRONG>);</STRONG> |
| 68 | <STRONG>int</STRONG> <STRONG>color_set(short</STRONG> <EM>color</EM><STRONG>_</STRONG><EM>pair</EM><STRONG>_</STRONG><EM>number</EM><STRONG>,</STRONG> <STRONG>void*</STRONG> <EM>opts</EM><STRONG>);</STRONG> |
| 69 | <STRONG>int</STRONG> <STRONG>wcolor_set(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>color</EM><STRONG>_</STRONG><EM>pair</EM><STRONG>_</STRONG><EM>number</EM><STRONG>,</STRONG> |
| 70 | <STRONG>void*</STRONG> <EM>opts);</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 71 | <STRONG>int</STRONG> <STRONG>standend(void);</STRONG> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 72 | <STRONG>int</STRONG> <STRONG>wstandend(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 73 | <STRONG>int</STRONG> <STRONG>standout(void);</STRONG> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 74 | <STRONG>int</STRONG> <STRONG>wstandout(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
| 75 | <STRONG>int</STRONG> <STRONG>attr_get(attr_t</STRONG> <STRONG>*</STRONG><EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <STRONG>*</STRONG><EM>pair</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
| 76 | <STRONG>int</STRONG> <STRONG>wattr_get(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <STRONG>*</STRONG><EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <STRONG>*</STRONG><EM>pair</EM><STRONG>,</STRONG> |
| 77 | <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
| 78 | <STRONG>int</STRONG> <STRONG>attr_off(attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
| 79 | <STRONG>int</STRONG> <STRONG>wattr_off(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
| 80 | <STRONG>int</STRONG> <STRONG>attr_on(attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
| 81 | <STRONG>int</STRONG> <STRONG>wattr_on(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
| 82 | <STRONG>int</STRONG> <STRONG>attr_set(attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
| 83 | <STRONG>int</STRONG> <STRONG>wattr_set(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>void</STRONG> |
| 84 | <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
| 85 | <STRONG>int</STRONG> <STRONG>chgat(int</STRONG> <EM>n</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attr</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>color</EM><STRONG>,</STRONG> |
| 86 | <STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
| 87 | <STRONG>int</STRONG> <STRONG>wchgat(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attr</EM><STRONG>,</STRONG> |
| 88 | <STRONG>short</STRONG> <EM>color</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
| 89 | <STRONG>int</STRONG> <STRONG>mvchgat(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attr</EM><STRONG>,</STRONG> |
| 90 | <STRONG>short</STRONG> <EM>color</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
| 91 | <STRONG>int</STRONG> <STRONG>mvwchgat(WINDOW</STRONG> <STRONG>*</STRONG><EM>win,</EM> <EM>int</EM> <EM>y,</EM> <EM>int</EM> <EM>x,</EM> <EM>int</EM> <EM>n,</EM> |
| 92 | <STRONG>attr_t</STRONG> <EM>attr</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>color</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 93 | |
| 94 | |
| 95 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 96 | <H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 97 | These routines manipulate the current attributes of the |
| 98 | named window. The current attributes of a window apply to |
| 99 | all characters that are written into the window with <STRONG>wadd-</STRONG> |
| 100 | <STRONG>ch</STRONG>, <STRONG>waddstr</STRONG> and <STRONG>wprintw</STRONG>. Attributes are a property of the |
| 101 | character, and move with the character through any |
| 102 | scrolling and insert/delete line/character operations. To |
| 103 | the extent possible, they are displayed as appropriate |
| 104 | modifications to the graphic rendition of characters put |
| 105 | on the screen. |
| 106 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 107 | |
| 108 | </PRE> |
| 109 | <H3><a name="h3-attrset">attrset</a></H3><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 110 | The routine <STRONG>attrset</STRONG> sets the current attributes of the |
| 111 | given window to <EM>attrs</EM>. The routine <STRONG>attroff</STRONG> turns off the |
| 112 | named attributes without turning any other attributes on |
| 113 | or off. The routine <STRONG>attron</STRONG> turns on the named attributes |
| 114 | without affecting any others. The routine <STRONG>standout</STRONG> is the |
| 115 | same as <STRONG>attron(A_STANDOUT)</STRONG>. The routine <STRONG>standend</STRONG> is the |
| 116 | same as <STRONG>attrset(A_NORMAL)</STRONG> or <STRONG>attrset(0)</STRONG>, that is, it turns |
| 117 | off all attributes. |
| 118 | |
| 119 | The <STRONG>attrset</STRONG> and related routines do not affect the at- |
| 120 | tributes used when erasing portions of the window. See |
| 121 | <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG> for functions which modify the attributes |
| 122 | used for erasing and clearing. |
| 123 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 124 | |
| 125 | </PRE> |
| 126 | <H3><a name="h3-attr_set">attr_set</a></H3><PRE> |
| 127 | The <STRONG>attrset</STRONG> routine is actually a legacy feature predating |
| 128 | SVr4 curses but kept in X/Open Curses for the same reason |
| 129 | that SVr4 curses kept it: compatbility. The routine <STRONG>at-</STRONG> |
| 130 | <STRONG>tr_set</STRONG> provides for passing a color-pair parameter. |
| 131 | |
| 132 | The remaining <STRONG>attr_</STRONG>* functions operate exactly like the |
| 133 | corresponding <STRONG>attr</STRONG>* functions, except that they take argu- |
| 134 | ments of type <STRONG>attr_t</STRONG> rather than <STRONG>int</STRONG>. |
| 135 | |
| 136 | |
| 137 | </PRE> |
| 138 | <H3><a name="h3-color_set">color_set</a></H3><PRE> |
| 139 | The routine <STRONG>color_set</STRONG> sets the current color of the given |
| 140 | window to the foreground/background combination described |
| 141 | by the color_pair_number. The parameter opts is reserved |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 142 | for future use, applications must supply a null pointer. |
| 143 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 144 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 145 | </PRE> |
| 146 | <H3><a name="h3-attr_get">attr_get</a></H3><PRE> |
| 147 | The routine <STRONG>wattr_get</STRONG> returns the current attribute and |
| 148 | color pair for the given window; <STRONG>attr_get</STRONG> returns the cur- |
| 149 | rent attribute and color pair for <STRONG>stdscr</STRONG>. |
| 150 | |
| 151 | There is no corresponding <STRONG>attrget</STRONG> function as such in |
| 152 | X/Open Curses, although ncurses provides <STRONG>getattrs</STRONG> (see |
| 153 | <STRONG><A HREF="curs_legacy.3x.html">curs_legacy(3x)</A></STRONG>). |
| 154 | |
| 155 | |
| 156 | </PRE> |
| 157 | <H3><a name="h3-chgat">chgat</a></H3><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 158 | The routine <STRONG>chgat</STRONG> changes the attributes of a given number |
| 159 | of characters starting at the current cursor location of |
| 160 | <STRONG>stdscr</STRONG>. It does not update the cursor and does not per- |
| 161 | form wrapping. A character count of -1 or greater than |
| 162 | the remaining window width means to change attributes all |
| 163 | the way to the end of the current line. The <STRONG>wchgat</STRONG> func- |
| 164 | tion generalizes this to any window; the <STRONG>mvwchgat</STRONG> function |
| 165 | does a cursor move before acting. In these functions, the |
| 166 | color argument is a color-pair index (as in the first ar- |
| 167 | gument of <EM>init</EM><STRONG>_</STRONG><EM>pair</EM>, see <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>). The <STRONG>opts</STRONG> argu- |
| 168 | ment is not presently used, but is reserved for the future |
| 169 | (leave it <STRONG>NULL</STRONG>). |
| 170 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 171 | |
| 172 | </PRE> |
| 173 | <H3><a name="h3-Attributes">Attributes</a></H3><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 174 | The following video attributes, defined in <STRONG><curses.h></STRONG>, can |
| 175 | be passed to the routines <STRONG>attron</STRONG>, <STRONG>attroff</STRONG>, and <STRONG>attrset</STRONG>, or |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 176 | OR'd with the characters passed to <STRONG>addch</STRONG> (see curs_add- |
| 177 | <STRONG><A HREF="ch.3x.html">ch(3x)</A></STRONG>). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 178 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 179 | <EM>Name</EM> <EM>Description</EM> |
| 180 | ------------------------------------------------------------ |
| 181 | <STRONG>A_NORMAL</STRONG> Normal display (no highlight) |
| 182 | <STRONG>A_STANDOUT</STRONG> Best highlighting mode of the terminal. |
| 183 | <STRONG>A_UNDERLINE</STRONG> Underlining |
| 184 | <STRONG>A_REVERSE</STRONG> Reverse video |
| 185 | <STRONG>A_BLINK</STRONG> Blinking |
| 186 | <STRONG>A_DIM</STRONG> Half bright |
| 187 | <STRONG>A_BOLD</STRONG> Extra bright or bold |
| 188 | <STRONG>A_PROTECT</STRONG> Protected mode |
| 189 | <STRONG>A_INVIS</STRONG> Invisible or blank mode |
| 190 | <STRONG>A_ALTCHARSET</STRONG> Alternate character set |
| 191 | <STRONG>A_ITALIC</STRONG> Italics (non-X/Open extension) |
| 192 | <STRONG>A_CHARTEXT</STRONG> Bit-mask to extract a character |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 193 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 194 | <STRONG>COLOR_PAIR(</STRONG><EM>n</EM><STRONG>)</STRONG> Color-pair number <EM>n</EM> |
| 195 | |
| 196 | These video attributes are supported by <STRONG>attr_on</STRONG> and relat- |
| 197 | ed functions (which also support the attributes recognized |
| 198 | by <STRONG>attron</STRONG>, etc.): |
| 199 | |
| 200 | <EM>Name</EM> <EM>Description</EM> |
| 201 | ----------------------------------------- |
| 202 | <STRONG>WA_HORIZONTAL</STRONG> Horizontal highlight |
| 203 | <STRONG>WA_LEFT</STRONG> Left highlight |
| 204 | <STRONG>WA_LOW</STRONG> Low highlight |
| 205 | <STRONG>WA_RIGHT</STRONG> Right highlight |
| 206 | <STRONG>WA_TOP</STRONG> Top highlight |
| 207 | <STRONG>WA_VERTICAL</STRONG> Vertical highlight |
| 208 | |
| 209 | For consistency |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 210 | |
| 211 | The following macro is the reverse of <STRONG>COLOR_PAIR(</STRONG><EM>n</EM><STRONG>)</STRONG>: |
| 212 | |
| 213 | <STRONG>PAIR_NUMBER(</STRONG><EM>attrs</EM>) Returns the pair number associated |
| 214 | with the <STRONG>COLOR_PAIR(</STRONG><EM>n</EM><STRONG>)</STRONG> attribute. |
| 215 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 216 | The return values of many of these routines are not mean- |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 217 | ingful (they are implemented as macro-expanded assignments |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 218 | and simply return their argument). The SVr4 manual page |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 219 | claims (falsely) that these routines always return <STRONG>1</STRONG>. |
| 220 | |
| 221 | |
| 222 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 223 | <H2><a name="h2-NOTES">NOTES</a></H2><PRE> |
| 224 | Note that <STRONG>attroff</STRONG>, <STRONG>wattroff</STRONG>, <STRONG>attron</STRONG>, <STRONG>wattron</STRONG>, <STRONG>attrset</STRONG>, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 225 | <STRONG>wattrset</STRONG>, <STRONG>standend</STRONG> and <STRONG>standout</STRONG> may be macros. |
| 226 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 227 | <STRONG>COLOR_PAIR</STRONG> values can only be OR'd with attributes if the |
| 228 | pair number is less than 256. The alternate functions |
| 229 | such as <STRONG>color_set</STRONG> can pass a color pair value directly. |
| 230 | However, ncurses ABI 4 and 5 simply OR this value within |
| 231 | the alternate functions. You must use ncurses ABI 6 to |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 232 | support more than 256 color pairs. |
| 233 | |
| 234 | |
| 235 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 236 | <H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE> |
| 237 | These functions are supported in the XSI Curses standard, |
| 238 | Issue 4. The standard defined the dedicated type for |
| 239 | highlights, <STRONG>attr_t</STRONG>, which is not defined in SVr4 curses. |
| 240 | The functions taking <STRONG>attr_t</STRONG> arguments are not supported |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 241 | under SVr4. |
| 242 | |
| 243 | The XSI Curses standard states that whether the tradition- |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 244 | al functions <STRONG>attron</STRONG>/<STRONG>attroff</STRONG>/<STRONG>attrset</STRONG> can manipulate at- |
| 245 | tributes other than <STRONG>A_BLINK</STRONG>, <STRONG>A_BOLD</STRONG>, <STRONG>A_DIM</STRONG>, <STRONG>A_REVERSE</STRONG>, |
| 246 | <STRONG>A_STANDOUT</STRONG>, or <STRONG>A_UNDERLINE</STRONG> is "unspecified". Under this |
| 247 | implementation as well as SVr4 curses, these functions |
| 248 | correctly manipulate all other highlights (specifically, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 249 | <STRONG>A_ALTCHARSET</STRONG>, <STRONG>A_PROTECT</STRONG>, and <STRONG>A_INVIS</STRONG>). |
| 250 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 251 | This implementation provides the <STRONG>A_ITALIC</STRONG> attribute for |
| 252 | terminals which have the <EM>enter</EM><STRONG>_</STRONG><EM>italics</EM><STRONG>_</STRONG><EM>mode</EM> (sitm) and <EM>ex-</EM> |
| 253 | <EM>it</EM><STRONG>_</STRONG><EM>italics</EM><STRONG>_</STRONG><EM>mode</EM> (ritm) capabilities. Italics are not men- |
| 254 | tioned in X/Open Curses. Unlike the other video at- |
| 255 | tributes, <STRONG>I_ITALIC</STRONG> is unrelated to the <EM>set</EM><STRONG>_</STRONG><EM>attributes</EM> ca- |
| 256 | pabilities. This implementation makes the assumption that |
| 257 | <EM>exit</EM><STRONG>_</STRONG><EM>attribute</EM><STRONG>_</STRONG><EM>mode</EM> may also reset italics. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 258 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 259 | XSI Curses added the new entry points, <STRONG>attr_get</STRONG>, <STRONG>attr_on</STRONG>, |
| 260 | <STRONG>attr_off</STRONG>, <STRONG>attr_set</STRONG>, <STRONG>wattr_on</STRONG>, <STRONG>wattr_off</STRONG>, <STRONG>wattr_get</STRONG>, <STRONG>wat-</STRONG> |
| 261 | <STRONG>tr_set</STRONG>. These are intended to work with a new series of |
| 262 | highlight macros prefixed with <STRONG>WA_</STRONG>. The older macros have |
| 263 | direct counterparts in the newer set of names: |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 264 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 265 | <EM>Name</EM> <EM>Description</EM> |
| 266 | ------------------------------------------------------------ |
| 267 | <STRONG>WA_NORMAL</STRONG> Normal display (no highlight) |
| 268 | <STRONG>WA_STANDOUT</STRONG> Best highlighting mode of the terminal. |
| 269 | <STRONG>WA_UNDERLINE</STRONG> Underlining |
| 270 | <STRONG>WA_REVERSE</STRONG> Reverse video |
| 271 | <STRONG>WA_BLINK</STRONG> Blinking |
| 272 | <STRONG>WA_DIM</STRONG> Half bright |
| 273 | <STRONG>WA_BOLD</STRONG> Extra bright or bold |
| 274 | <STRONG>WA_ALTCHARSET</STRONG> Alternate character set |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 275 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 276 | Very old versions of this library did not force an update |
| 277 | of the screen when changing the attributes. Use <STRONG>touchwin</STRONG> |
| 278 | to force the screen to match the updated attributes. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 279 | |
| 280 | The XSI curses standard specifies that each pair of corre- |
| 281 | sponding <STRONG>A_</STRONG> and <STRONG>WA_</STRONG>-using functions operates on the same |
| 282 | current-highlight information. |
| 283 | |
| 284 | The XSI standard extended conformance level adds new high- |
| 285 | lights <STRONG>A_HORIZONTAL</STRONG>, <STRONG>A_LEFT</STRONG>, <STRONG>A_LOW</STRONG>, <STRONG>A_RIGHT</STRONG>, <STRONG>A_TOP</STRONG>, <STRONG>A_VER-</STRONG> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 286 | <STRONG>TICAL</STRONG> (and corresponding <STRONG>WA_</STRONG> macros for each). As of Au- |
| 287 | gust 2013, no known terminal provides these highlights |
| 288 | (i.e., via the <STRONG>sgr1</STRONG> capability). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 289 | |
| 290 | |
| 291 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 292 | <H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE> |
| 293 | All routines return the integer <STRONG>OK</STRONG> on success, or <STRONG>ERR</STRONG> on |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 294 | failure. |
| 295 | |
| 296 | X/Open does not define any error conditions. |
| 297 | |
| 298 | This implementation returns an error if the window pointer |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 299 | is null. The <STRONG>wcolor_set</STRONG> function returns an error if the |
| 300 | color pair parameter is outside the range 0..COL- |
| 301 | OR_PAIRS-1. This implementation also provides <STRONG>getattrs</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 302 | for compatibility with older versions of curses. |
| 303 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 304 | Functions with a "mv" prefix first perform a cursor move- |
| 305 | ment using <STRONG>wmove</STRONG>, and return an error if the position is |
| 306 | outside the window, or if the window pointer is null. |
| 307 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 308 | |
| 309 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 310 | <H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE> |
| 311 | <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>, |
| 312 | <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>, <STRONG><A HREF="curs_printw.3x.html">curs_printw(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 313 | |
| 314 | |
| 315 | |
| 316 | <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG> |
| 317 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 318 | <div class="nav"> |
| 319 | <ul> |
| 320 | <li><a href="#h2-NAME">NAME</a></li> |
| 321 | <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li> |
| 322 | <li><a href="#h2-DESCRIPTION">DESCRIPTION</a> |
| 323 | <ul> |
| 324 | <li><a href="#h3-attrset">attrset</a></li> |
| 325 | <li><a href="#h3-attr_set">attr_set</a></li> |
| 326 | <li><a href="#h3-color_set">color_set</a></li> |
| 327 | <li><a href="#h3-attr_get">attr_get</a></li> |
| 328 | <li><a href="#h3-chgat">chgat</a></li> |
| 329 | <li><a href="#h3-Attributes">Attributes</a></li> |
| 330 | </ul> |
| 331 | </li> |
| 332 | <li><a href="#h2-NOTES">NOTES</a></li> |
| 333 | <li><a href="#h2-PORTABILITY">PORTABILITY</a></li> |
| 334 | <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li> |
| 335 | <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li> |
| 336 | </ul> |
| 337 | </div> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 338 | </BODY> |
| 339 | </HTML> |