]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_add_wch.3x.html
ncurses 5.8 - patch 20110226
[ncurses.git] / doc / html / man / curs_add_wch.3x.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <!-- 
3   ****************************************************************************
4   * Copyright (c) 2001-2010,2011 Free Software Foundation, Inc.              *
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   ****************************************************************************
30   * @Id: curs_add_wch.3x,v 1.14 2011/01/15 15:27:43 tom Exp @
31 -->
32 <HTML>
33 <HEAD>
34 <TITLE>curs_add_wch 3x</TITLE>
35 <link rev=made href="mailto:bug-ncurses@gnu.org">
36 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
37 </HEAD>
38 <BODY>
39 <H1>curs_add_wch 3x</H1>
40 <HR>
41 <PRE>
42 <!-- Manpage converted by man2html 3.0.1 -->
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>
49 <H2>NAME</H2><PRE>
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>
56 <H2>SYNOPSIS</H2><PRE>
57        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</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>
69 <H2>DESCRIPTION</H2><PRE>
70        The <STRONG>add_wch</STRONG>, <STRONG>wadd_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, and <STRONG>mvwadd_wch</STRONG> functions
71        put the complex character <EM>wch</EM> into the given window at its
72        current position, which is then advanced.  These functions
73        perform  wrapping and special-character processing as fol-
74        lows:
75
76        <STRONG>o</STRONG>   If <EM>wch</EM> refers to a spacing character, then any  previ-
77            ous  character  at  that  location  is removed.  A new
78            character specified by <EM>wch</EM> is placed at that  location
79            with  rendition  specified  by  <EM>wch</EM>.   The cursor then
80            advances to the next spacing character on the  screen.
81
82        <STRONG>o</STRONG>   If <EM>wch</EM> refers to a non-spacing character, all previous
83            characters at that location are preserved.   The  non-
84            spacing  characters  of  <EM>wch</EM>  are added to the spacing
85            complex character, and the rendition specified by  <EM>wch</EM>
86            is ignored.
87
88        <STRONG>o</STRONG>   If  the  character  part  of  <EM>wch</EM>  is  a tab, newline,
89            backspace or other control character,  the  window  is
90            updated  and the cursor moves as if <STRONG>addch</STRONG> were called.
91
92        The <STRONG>echo_wchar</STRONG> function is functionally  equivalent  to  a
93        call to <STRONG>add_wch</STRONG> followed by a call to <STRONG>refresh</STRONG>.  Similarly,
94        the <STRONG>wecho_wchar</STRONG> is functionally equivalent to  a  call  to
95        <STRONG>wadd_wch</STRONG>  followed  by  a call to <STRONG>wrefresh</STRONG>.  The knowledge
96        that only a single character is being output is taken into
97        consideration and, for non-control characters, a consider-
98        able performance gain might be seen by  using  the  *<STRONG>echo</STRONG>*
99        functions instead of their equivalents.
100
101    <STRONG>Line</STRONG> <STRONG>Graphics</STRONG>
102        Like  <STRONG><A HREF="addch.3x.html">addch(3x)</A></STRONG>,  <STRONG>addch_wch</STRONG>  accepts symbols which make it
103        simple to draw lines and  other  frequently  used  special
104        characters.   These  symbols  correspond to the same VT100
105        line-drawing set as <STRONG><A HREF="addch.3x.html">addch(3x)</A></STRONG>.
106
107
108        <EM>Name</EM>              <EM>Unicode</EM>    <EM>Default</EM>   <EM>Description</EM>
109        ----------------------------------------------------------------
110        WACS_BLOCK        0x25ae     #         solid square block
111        WACS_BOARD        0x2592     #         board of squares
112        WACS_BTEE         0x2534     +         bottom tee
113        WACS_BULLET       0x00b7     o         bullet
114
115        WACS_CKBOARD      0x2592     :         checker board (stipple)
116        WACS_DARROW       0x2193     v         arrow pointing down
117        WACS_DEGREE       0x00b0     '         degree symbol
118        WACS_DIAMOND      0x25c6     +         diamond
119        WACS_GEQUAL       0x2265     &gt;         greater-than-or-equal-to
120        WACS_HLINE        0x2500     -         horizontal line
121        WACS_LANTERN      0x2603     #         lantern symbol
122        WACS_LARROW       0x2190     &lt;         arrow pointing left
123        WACS_LEQUAL       0x2264     &lt;         less-than-or-equal-to
124        WACS_LLCORNER     0x2514     +         lower left-hand corner
125        WACS_LRCORNER     0x2518     +         lower right-hand corner
126        WACS_LTEE         0x2524     +         left tee
127        WACS_NEQUAL       0x2260     !         not-equal
128        WACS_PI           0x03c0     *         greek pi
129        WACS_PLMINUS      0x00b1     #         plus/minus
130        WACS_PLUS         0x253c     +         plus
131        WACS_RARROW       0x2192     &gt;         arrow pointing right
132        WACS_RTEE         0x251c     +         right tee
133        WACS_S1           0x23ba     -         scan line 1
134        WACS_S3           0x23bb     -         scan line 3
135        WACS_S7           0x23bc     -         scan line 7
136        WACS_S9           0x23bd     _         scan line 9
137        WACS_STERLING     0x00a3     f         pound-sterling symbol
138        WACS_TTEE         0x252c     +         top tee
139        WACS_UARROW       0x2191     ^         arrow pointing up
140        WACS_ULCORNER     0x250c     +         upper left-hand corner
141        WACS_URCORNER     0x2510     +         upper right-hand corner
142        WACS_VLINE        0x2502     |         vertical line
143
144        The wide-character configuration of ncurses  also  defines
145        symbols for thick- and double-lines:
146
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>
175 <H2>RETURN VALUES</H2><PRE>
176        All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on
177        success.
178
179        Functions with a "mv" prefix first perform a cursor  move-
180        ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
181        outside the window, or if the window pointer is null.
182
183
184 </PRE>
185 <H2>NOTES</H2><PRE>
186        Note that <STRONG>add_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>,  and  <STRONG>echo_wchar</STRONG>
187        may be macros.
188
189
190 </PRE>
191 <H2>PORTABILITY</H2><PRE>
192        All  of  these  functions  are described in the XSI Curses
193        standard, Issue 4.  The defaults specified for  line-draw-
194        ing characters apply in the POSIX locale.
195
196        X/Open Curses makes it clear that the WACS_ symbols should
197        be defined as a pointer to <STRONG>cchar_t</STRONG> data, e.g., in the dis-
198        cussion of <STRONG>border_set</STRONG>.  A few implementations are problem-
199        atic:
200
201        <STRONG>o</STRONG>   NetBSD curses defines the symbols as a <STRONG>wchar_t</STRONG>  within
202            a <STRONG>cchar_t</STRONG>.
203
204        <STRONG>o</STRONG>   HPUX  curses  equates  some of the <EM>ACS</EM><STRONG>_</STRONG> symbols to the
205            analogous <EM>WACS</EM><STRONG>_</STRONG> symbols as if the  <EM>ACS</EM><STRONG>_</STRONG>  symbols  were
206            wide  characters.   The  misdefined  symbols  are  the
207            arrows and other symbols which are not used for  line-
208            drawing.
209
210        X/Open  Curses  does not define symbols for thick- or dou-
211        ble-lines.   SVr4  curses  implementations  defined  their
212        line-drawing  symbols  in  terms  of intermediate symbols.
213        This implementation extends those symbols,  providing  new
214        definitions which are not in the SVr4 implementations.
215
216
217 </PRE>
218 <H2>SEE ALSO</H2><PRE>
219        <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>,
220        <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><A HREF="putwc.3.html">putwc(3)</A></STRONG>
221
222
223
224                                                        <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>
225 </PRE>
226 <HR>
227 <ADDRESS>
228 Man(1) output converted with
229 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
230 </ADDRESS>
231 </BODY>
232 </HTML>