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