Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | <!-- |
| 2 | **************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 3 | * Copyright (c) 2001-2012,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 | **************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 29 | * @Id: curs_add_wch.3x,v 1.16 2015/07/20 23:44:56 tom Exp @ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 30 | --> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 31 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 32 | <HTML> |
| 33 | <HEAD> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 34 | <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
| 35 | <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] | 36 | <TITLE>curs_add_wch 3x</TITLE> |
| 37 | <link rev=made href="mailto:bug-ncurses@gnu.org"> |
| 38 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 39 | </HEAD> |
| 40 | <BODY> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 41 | <H1 class="no-header">curs_add_wch 3x</H1> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 42 | <PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 43 | <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG> <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG> |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 49 | <H2><a name="h2-NAME">NAME</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 50 | <STRONG>add_wch</STRONG>, <STRONG>wadd_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>, <STRONG>echo_wchar</STRONG>, |
| 51 | <STRONG>wecho_wchar</STRONG> - add a complex character and rendition to a |
| 52 | <STRONG>curses</STRONG> window, then advance the cursor |
| 53 | |
| 54 | |
| 55 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 56 | <H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 57 | <STRONG>#include</STRONG> <STRONG><curses.h></STRONG> |
| 58 | |
| 59 | <STRONG>int</STRONG> <STRONG>add_wch(</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG> |
| 60 | <STRONG>int</STRONG> <STRONG>wadd_wch(</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG> |
| 61 | <STRONG>int</STRONG> <STRONG>mvadd_wch(</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG> |
| 62 | <STRONG>int</STRONG> <STRONG>mvwadd_wch(</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> |
| 63 | <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG> |
| 64 | <STRONG>int</STRONG> <STRONG>echo_wchar(</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG> |
| 65 | <STRONG>int</STRONG> <STRONG>wecho_wchar(</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG> |
| 66 | |
| 67 | |
| 68 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 69 | <H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE> |
| 70 | |
| 71 | </PRE> |
| 72 | <H3><a name="h3-add_wch">add_wch</a></H3><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 73 | The <STRONG>add_wch</STRONG>, <STRONG>wadd_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, and <STRONG>mvwadd_wch</STRONG> functions |
| 74 | put the complex character <EM>wch</EM> into the given window at its |
| 75 | current position, which is then advanced. These functions |
| 76 | perform wrapping and special-character processing as fol- |
| 77 | lows: |
| 78 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 79 | <STRONG>o</STRONG> If <EM>wch</EM> refers to a spacing character, then any previ- |
| 80 | ous character at that location is removed. A new |
| 81 | character specified by <EM>wch</EM> is placed at that location |
| 82 | with rendition specified by <EM>wch</EM>. The cursor then |
| 83 | advances to the next spacing character on the screen. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 84 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 85 | <STRONG>o</STRONG> If <EM>wch</EM> refers to a non-spacing character, all previous |
| 86 | characters at that location are preserved. The non- |
| 87 | spacing characters of <EM>wch</EM> are added to the spacing |
| 88 | complex character, and the rendition specified by <EM>wch</EM> |
| 89 | is ignored. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 90 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 91 | <STRONG>o</STRONG> If the character part of <EM>wch</EM> is a tab, newline, |
| 92 | backspace or other control character, the window is |
| 93 | updated and the cursor moves as if <STRONG>addch</STRONG> were called. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 94 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 95 | |
| 96 | </PRE> |
| 97 | <H3><a name="h3-echo_wchar">echo_wchar</a></H3><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 98 | The <STRONG>echo_wchar</STRONG> function is functionally equivalent to a |
| 99 | call to <STRONG>add_wch</STRONG> followed by a call to <STRONG>refresh</STRONG>. Similarly, |
| 100 | the <STRONG>wecho_wchar</STRONG> is functionally equivalent to a call to |
| 101 | <STRONG>wadd_wch</STRONG> followed by a call to <STRONG>wrefresh</STRONG>. The knowledge |
| 102 | that only a single character is being output is taken into |
| 103 | consideration and, for non-control characters, a consider- |
| 104 | able performance gain might be seen by using the *<STRONG>echo</STRONG>* |
| 105 | functions instead of their equivalents. |
| 106 | |
| 107 | |
| 108 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 109 | <H3><a name="h3-Line-Graphics">Line Graphics</a></H3><PRE> |
| 110 | Like <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG>addch_wch</STRONG> accepts symbols which make it |
| 111 | simple to draw lines and other frequently used special |
| 112 | characters. These symbols correspond to the same VT100 |
| 113 | line-drawing set as <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>. |
| 114 | |
| 115 | <EM>Name</EM> <EM>Unicode</EM> <EM>Default</EM> <EM>Description</EM> |
| 116 | ---------------------------------------------------------------- |
| 117 | WACS_BLOCK 0x25ae # solid square block |
| 118 | WACS_BOARD 0x2592 # board of squares |
| 119 | WACS_BTEE 0x2534 + bottom tee |
| 120 | |
| 121 | WACS_BULLET 0x00b7 o bullet |
| 122 | WACS_CKBOARD 0x2592 : checker board (stipple) |
| 123 | WACS_DARROW 0x2193 v arrow pointing down |
| 124 | WACS_DEGREE 0x00b0 ' degree symbol |
| 125 | WACS_DIAMOND 0x25c6 + diamond |
| 126 | WACS_GEQUAL 0x2265 > greater-than-or-equal-to |
| 127 | WACS_HLINE 0x2500 - horizontal line |
| 128 | WACS_LANTERN 0x2603 # lantern symbol |
| 129 | WACS_LARROW 0x2190 < arrow pointing left |
| 130 | WACS_LEQUAL 0x2264 < less-than-or-equal-to |
| 131 | WACS_LLCORNER 0x2514 + lower left-hand corner |
| 132 | WACS_LRCORNER 0x2518 + lower right-hand corner |
| 133 | WACS_LTEE 0x2524 + left tee |
| 134 | WACS_NEQUAL 0x2260 ! not-equal |
| 135 | WACS_PI 0x03c0 * greek pi |
| 136 | WACS_PLMINUS 0x00b1 # plus/minus |
| 137 | WACS_PLUS 0x253c + plus |
| 138 | WACS_RARROW 0x2192 > arrow pointing right |
| 139 | WACS_RTEE 0x251c + right tee |
| 140 | WACS_S1 0x23ba - scan line 1 |
| 141 | WACS_S3 0x23bb - scan line 3 |
| 142 | WACS_S7 0x23bc - scan line 7 |
| 143 | WACS_S9 0x23bd _ scan line 9 |
| 144 | WACS_STERLING 0x00a3 f pound-sterling symbol |
| 145 | WACS_TTEE 0x252c + top tee |
| 146 | WACS_UARROW 0x2191 ^ arrow pointing up |
| 147 | WACS_ULCORNER 0x250c + upper left-hand corner |
| 148 | WACS_URCORNER 0x2510 + upper right-hand corner |
| 149 | WACS_VLINE 0x2502 | vertical line |
| 150 | |
| 151 | The wide-character configuration of ncurses also defines |
| 152 | symbols for thick- and double-lines: |
| 153 | |
| 154 | <EM>Name</EM> <EM>Unicode</EM> <EM>Default</EM> <EM>Description</EM> |
| 155 | --------------------------------------------------------------------- |
| 156 | WACS_T_ULCORNER 0x250f + thick upper left corner |
| 157 | WACS_T_LLCORNER 0x2517 + thick lower left corner |
| 158 | WACS_T_URCORNER 0x2513 + thick upper right corner |
| 159 | WACS_T_LRCORNER 0x251b + thick lower right corner |
| 160 | WACS_T_LTEE 0x252b + thick tee pointing right |
| 161 | WACS_T_RTEE 0x2523 + thick tee pointing left |
| 162 | WACS_T_BTEE 0x253b + thick tee pointing up |
| 163 | WACS_T_TTEE 0x2533 + thick tee pointing down |
| 164 | WACS_T_HLINE 0x2501 - thick horizontal line |
| 165 | WACS_T_VLINE 0x2503 | thick vertical line |
| 166 | WACS_T_PLUS 0x254b + thick large plus or crossover |
| 167 | WACS_D_ULCORNER 0x2554 + double upper left corner |
| 168 | WACS_D_LLCORNER 0x255a + double lower left corner |
| 169 | WACS_D_URCORNER 0x2557 + double upper right corner |
| 170 | WACS_D_LRCORNER 0x255d + double lower right corner |
| 171 | WACS_D_RTEE 0x2563 + double tee pointing left |
| 172 | WACS_D_LTEE 0x2560 + double tee pointing right |
| 173 | WACS_D_BTEE 0x2569 + double tee pointing up |
| 174 | WACS_D_TTEE 0x2566 + double tee pointing down |
| 175 | WACS_D_HLINE 0x2550 - double horizontal line |
| 176 | WACS_D_VLINE 0x2551 | double vertical line |
| 177 | WACS_D_PLUS 0x256c + double large plus or crossover |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 178 | |
| 179 | |
| 180 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 181 | <H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE> |
| 182 | All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on |
| 183 | success. |
| 184 | |
| 185 | Functions with a "mv" prefix first perform a cursor move- |
| 186 | ment using <STRONG>wmove</STRONG>, and return an error if the position is |
| 187 | outside the window, or if the window pointer is null. |
| 188 | |
| 189 | |
| 190 | </PRE> |
| 191 | <H2><a name="h2-NOTES">NOTES</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 192 | Note that <STRONG>add_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>, and <STRONG>echo_wchar</STRONG> |
| 193 | may be macros. |
| 194 | |
| 195 | |
| 196 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 197 | <H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE> |
| 198 | All of these functions are described in the XSI Curses |
| 199 | standard, Issue 4. The defaults specified for line-draw- |
| 200 | ing characters apply in the POSIX locale. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 201 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 202 | X/Open Curses makes it clear that the WACS_ symbols should |
| 203 | be defined as a pointer to <STRONG>cchar_t</STRONG> data, e.g., in the dis- |
| 204 | cussion of <STRONG>border_set</STRONG>. A few implementations are problem- |
| 205 | atic: |
| 206 | |
| 207 | <STRONG>o</STRONG> NetBSD curses defines the symbols as a <STRONG>wchar_t</STRONG> within |
| 208 | a <STRONG>cchar_t</STRONG>. |
| 209 | |
| 210 | <STRONG>o</STRONG> HPUX curses equates some of the <EM>ACS</EM><STRONG>_</STRONG> symbols to the |
| 211 | analogous <EM>WACS</EM><STRONG>_</STRONG> symbols as if the <EM>ACS</EM><STRONG>_</STRONG> symbols were |
| 212 | wide characters. The misdefined symbols are the |
| 213 | arrows and other symbols which are not used for line- |
| 214 | drawing. |
| 215 | |
| 216 | X/Open Curses does not define symbols for thick- or dou- |
| 217 | ble-lines. SVr4 curses implementations defined their |
| 218 | line-drawing symbols in terms of intermediate symbols. |
| 219 | This implementation extends those symbols, providing new |
| 220 | definitions which are not in the SVr4 implementations. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 221 | |
| 222 | |
| 223 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 224 | <H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 225 | <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_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 226 | <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG>putwc(3)</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 227 | |
| 228 | |
| 229 | |
| 230 | <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG> |
| 231 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 232 | <div class="nav"> |
| 233 | <ul> |
| 234 | <li><a href="#h2-NAME">NAME</a></li> |
| 235 | <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li> |
| 236 | <li><a href="#h2-DESCRIPTION">DESCRIPTION</a> |
| 237 | <ul> |
| 238 | <li><a href="#h3-add_wch">add_wch</a></li> |
| 239 | <li><a href="#h3-echo_wchar">echo_wchar</a></li> |
| 240 | <li><a href="#h3-Line-Graphics">Line Graphics</a></li> |
| 241 | </ul> |
| 242 | </li> |
| 243 | <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li> |
| 244 | <li><a href="#h2-NOTES">NOTES</a></li> |
| 245 | <li><a href="#h2-PORTABILITY">PORTABILITY</a></li> |
| 246 | <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li> |
| 247 | </ul> |
| 248 | </div> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 249 | </BODY> |
| 250 | </HTML> |