1 .\"***************************************************************************
2 .\" Copyright (c) 2001-2010,2011 Free Software Foundation, Inc. *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a *
5 .\" copy of this software and associated documentation files (the *
6 .\" "Software"), to deal in the Software without restriction, including *
7 .\" without limitation the rights to use, copy, modify, merge, publish, *
8 .\" distribute, distribute with modifications, sublicense, and/or sell *
9 .\" copies of the Software, and to permit persons to whom the Software is *
10 .\" furnished to do so, subject to the following conditions: *
12 .\" The above copyright notice and this permission notice shall be included *
13 .\" in all copies or substantial portions of the Software. *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 .\" Except as contained in this notice, the name(s) of the above copyright *
24 .\" holders shall not be used in advertising or otherwise to promote the *
25 .\" sale, use or other dealings in this Software without prior written *
27 .\"***************************************************************************
29 .\" $Id: curs_add_wch.3x,v 1.14 2011/01/15 15:27:43 tom Exp $
40 \fBwecho_wchar\fP \- add a complex character and rendition to a \fBcurses\fR window, then advance the cursor
43 \fB#include <curses.h>\fP
45 .B "int add_wch( const cchar_t *\fIwch\fB );"
47 .B "int wadd_wch( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );"
49 .B "int mvadd_wch( int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );"
51 .B "int mvwadd_wch( WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );"
53 .B "int echo_wchar( const cchar_t *\fIwch\fB );"
55 .B "int wecho_wchar( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );"
64 functions put the complex character \fIwch\fP into the given
65 window at its current position,
66 which is then advanced.
67 These functions perform
68 wrapping and special-character processing as follows:
70 If \fIwch\fP refers to a spacing character,
71 then any previous character at that location is removed.
72 A new character specified by \fIwch\fP is
73 placed at that location with rendition specified by \fIwch\fP.
74 The cursor then advances to
75 the next spacing character on the screen.
77 If \fIwch\fP refers to a non-spacing character,
78 all previous characters at that location are preserved.
79 The non-spacing characters of \fIwch\fP
80 are added to the spacing complex character,
81 and the rendition specified by \fIwch\fP is ignored.
83 If the character part of \fIwch\fP is
84 a tab, newline, backspace or other control character,
85 the window is updated and the cursor moves as if \fBaddch\fR were called.
88 function is functionally equivalent to a call to
94 is functionally equivalent to a call to
99 that only a single character is being output is taken into consideration and,
100 for non-control characters, a considerable performance gain might be seen
101 by using the *\fBecho\fP* functions instead of their equivalents.
104 \fBaddch_wch\fP accepts symbols which make it simple to draw lines and other
105 frequently used special characters.
106 These symbols correspond to the same VT100 line-drawing set as
112 lw(1.5i) lw7 lw7 lw20.
113 \fIName\fR \fIUnicode\fP \fIDefault\fR \fIDescription\fR
114 WACS_BLOCK 0x25ae # solid square block
115 WACS_BOARD 0x2592 # board of squares
116 WACS_BTEE 0x2534 + bottom tee
117 WACS_BULLET 0x00b7 o bullet
118 WACS_CKBOARD 0x2592 : checker board (stipple)
119 WACS_DARROW 0x2193 v arrow pointing down
120 WACS_DEGREE 0x00b0 ' degree symbol
121 WACS_DIAMOND 0x25c6 + diamond
122 WACS_GEQUAL 0x2265 > greater-than-or-equal-to
123 WACS_HLINE 0x2500 \- horizontal line
124 WACS_LANTERN 0x2603 # lantern symbol
125 WACS_LARROW 0x2190 < arrow pointing left
126 WACS_LEQUAL 0x2264 < less-than-or-equal-to
127 WACS_LLCORNER 0x2514 + lower left-hand corner
128 WACS_LRCORNER 0x2518 + lower right-hand corner
129 WACS_LTEE 0x2524 + left tee
130 WACS_NEQUAL 0x2260 ! not-equal
131 WACS_PI 0x03c0 * greek pi
132 WACS_PLMINUS 0x00b1 # plus/minus
133 WACS_PLUS 0x253c + plus
134 WACS_RARROW 0x2192 > arrow pointing right
135 WACS_RTEE 0x251c + right tee
136 WACS_S1 0x23ba \- scan line 1
137 WACS_S3 0x23bb \- scan line 3
138 WACS_S7 0x23bc \- scan line 7
139 WACS_S9 0x23bd \&_ scan line 9
140 WACS_STERLING 0x00a3 f pound-sterling symbol
141 WACS_TTEE 0x252c + top tee
142 WACS_UARROW 0x2191 ^ arrow pointing up
143 WACS_ULCORNER 0x250c + upper left-hand corner
144 WACS_URCORNER 0x2510 + upper right-hand corner
145 WACS_VLINE 0x2502 | vertical line
148 The wide-character configuration of ncurses also defines symbols
149 for thick- and double-lines:
154 lw(1.5i) lw7 lw7 lw20.
155 \fIName\fR \fIUnicode\fP \fIDefault\fR \fIDescription\fR
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
181 All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
183 Functions with a "mv" prefix first perform a cursor movement using
184 \fBwmove\fP, and return an error if the position is outside the window,
185 or if the window pointer is null.
191 \fBmvwadd_wch\fP, and
196 All of these functions are described in the XSI Curses standard, Issue 4.
197 The defaults specified for line-drawing characters apply in the POSIX locale.
199 X/Open Curses makes it clear that the WACS_ symbols should be defined as
200 a pointer to \fBcchar_t\fP data, e.g., in the discussion of \fBborder_set\fR.
201 A few implementations are problematic:
203 NetBSD curses defines the symbols as a \fBwchar_t\fP within a \fBcchar_t\fP.
205 HPUX curses equates some of the \fIACS_\fP symbols
206 to the analogous \fIWACS_\fP symbols as if the \fIACS_\fP symbols were
208 The misdefined symbols are the arrows
209 and other symbols which are not used for line-drawing.
211 X/Open Curses does not define symbols for thick- or double-lines.
212 SVr4 curses implementations defined their line-drawing symbols in
213 terms of intermediate symbols.
214 This implementation extends those symbols, providing new definitions
215 which are not in the SVr4 implementations.
222 \fBcurs_outopts\fR(3),
223 \fBcurs_refresh\fR(3),