]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_add_wch.3x
8d5d640a4aa9d8eda2e1cfe5071f3512c5c29082
[ncurses.git] / man / curs_add_wch.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 2001-2006,2010 Free Software Foundation, Inc.              *
3 .\"                                                                          *
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:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
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.                               *
22 .\"                                                                          *
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       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_add_wch.3x,v 1.9 2010/09/18 20:18:34 tom Exp $
30 .TH curs_add_wch 3X ""
31 .de bP
32 .IP \(bu 4
33 ..
34 .SH NAME
35 \fBadd_wch\fP,
36 \fBwadd_wch\fP,
37 \fBmvadd_wch\fP,
38 \fBmvwadd_wch\fP,
39 \fBecho_wchar\fP,
40 \fBwecho_wchar\fP \- add a complex character and rendition to a \fBcurses\fR window, then advance the cursor
41 .SH SYNOPSIS
42 .PP
43 \fB#include <curses.h>\fP
44 .sp
45 .B "int add_wch( const cchar_t *\fIwch\fB );"
46 .br
47 .B "int wadd_wch( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );"
48 .br
49 .B "int mvadd_wch( int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );"
50 .br
51 .B "int mvwadd_wch( WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );"
52 .br
53 .B "int echo_wchar( const cchar_t *\fIwch\fB );"
54 .br
55 .B "int wecho_wchar( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );"
56 .br
57 .SH DESCRIPTION
58 .PP
59 The
60 \fBadd_wch\fP,
61 \fBwadd_wch\fP,
62 \fBmvadd_wch\fP, and
63 \fBmvwadd_wch\fP
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:
69 .bP
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.
76 .bP
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.
82 .bP
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.
86 .PP
87 The \fBecho_wchar\fP
88 function is functionally equivalent to a call to
89 \fBadd_wch\fP
90 followed by a call to
91 \fBrefresh\fP.
92 Similarly, the
93 \fBwecho_wchar\fP
94 is functionally equivalent to a call to
95 \fBwadd_wch\fP
96 followed by a call to
97 \fBwrefresh\fP.
98 The knowledge
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.
102 .SH RETURN VALUES
103 .PP
104 All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
105 .PP
106 Functions with a "mv" prefix first perform a cursor movement using
107 \fBwmove\fP, and return an error if the position is outside the window,
108 or if the window pointer is null.
109 .SH NOTES
110 .PP
111 Note that
112 \fBadd_wch\fP,
113 \fBmvadd_wch\fP,
114 \fBmvwadd_wch\fP, and
115 \fBecho_wchar\fP
116 may be macros.
117 .SH PORTABILITY
118 .PP
119 All these functions are described in the XSI Curses standard, Issue 4.
120 The defaults specified for forms-drawing characters apply in the POSIX locale.
121 .PP
122 XSI documents constants beginning with \fBWACS_\fP which are used for
123 line-drawing.
124 Those are not currently implemented in \fBncurses\fP.
125 .SH SEE ALSO
126 .PP
127 \fBcurses\fR(3X),
128 \fBcurs_addch\fR(3X),
129 \fBcurs_attr\fR(3X),
130 \fBcurs_clear\fR(3X),
131 \fBcurs_outopts\fR(3X),
132 \fBcurs_refresh\fR(3X),
133 \fBputwc\fR(3)
134 .\"#
135 .\"# The following sets edit modes for GNU EMACS
136 .\"# Local Variables:
137 .\"# mode:nroff
138 .\"# fill-column:79
139 .\"# End: