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