'\" te
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH CURS_ADDWCH 3CURSES "Dec 31, 1996"
.SH NAME
curs_addwch, addwch, waddwch, mvaddwch, mvwaddwch, echowchar, wechowchar \- add
a wchar_t character (with attributes) to a curses window and advance cursor
.SH SYNOPSIS
.LP
.nf
\fBcc\fR  [\fIflag\fR]... \fIfile\fR... \fB-lcurses\fR [\fIlibrary\fR]...
.fi

.LP
.nf
#include<curses.h>

\fBint\fR \fBaddwch\fR(\fBchtype\fR \fIwch\fR);
.fi

.LP
.nf
\fBint\fR \fBwaddwch\fR(\fBWINDOW *\fR\fIwin\fR, \fBchtype\fR \fIwch\fR);
.fi

.LP
.nf
\fBint\fR \fBmvaddwch\fR(\fBint\fR \fIy\fR, \fBint\fR \fIx\fR, \fBchtype\fR \fIwch\fR);
.fi

.LP
.nf
\fBint\fR \fBmvwaddwch\fR(\fBWINDOW *\fR\fIwin\fR, \fBint\fR \fIy\fR, \fBint\fR \fIx\fR, \fBchtype\fR \fIwch\fR);
.fi

.LP
.nf
\fBint\fR \fBechowchar\fR(\fBchtype\fR \fIwch\fR);
.fi

.LP
.nf
\fBint\fR \fBwechowchar\fR(\fBWINDOW *\fR\fIwin\fR, \fBchtype\fR \fIwch\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The  \fBaddwch()\fR,\fBwaddwch()\fR,\fBmvaddwch()\fR, and \fBmvwaddwch()\fR
routines put the character  \fIwch\fR, holding a \fBwchar_t\fR character, into
the window at the current cursor position of the window and advance the
position of the window cursor. Their function is similar to that of
\fBputwchar\fR(3C) in the C multibyte library. At the right margin, an
automatic newline is performed. At the bottom of the scrolling region, if
\fBscrollok\fR is enabled, the scrolling region is scrolled up one line.
.sp
.LP
If  \fIwch\fR is a tab, newline, or backspace, the cursor is moved
appropriately within the window. A newline also does a  \fBclrtoeol\fR(3CURSES)
before moving. Tabs are considered to be at every eighth column. If  \fIwch\fR
is another control character, it is drawn in the \fB^\fR\fIX\fR notation.
Calling  \fBwinwch\fR(3CURSES) after adding a control character does not return
the control character, but instead returns the representation of the control
character.
.sp
.LP
Video attributes can be combined with a  \fBwchar_t\fR character by OR-ing them
into the parameter. This results in these attributes also being set. (The
intent here is that text, including attributes, can be copied from one place to
another using  \fBinwch()\fR and  \fBaddwch()\fR.) See
\fBstandout\fR(3CURSES), predefined video attribute constants.
.sp
.LP
The  \fBechowchar()\fR and \fBwechowchar()\fR routines are functionally
equivalent to a call to  \fBaddwch()\fR followed by a call to
\fBrefresh\fR(3CURSES), or a call to  \fBwaddwch()\fR followed by a call to
\fBwrefresh\fR(3CURSES). The knowledge that only a single character is being
output is taken into consideration and, for non-control characters, a
considerable performance gain might be seen by using these routines instead of
their equivalents.
.SS "Line Graphics"
.sp
.LP
The following variables may be used to add line drawing characters to the
screen with routines of the  \fBaddwch()\fR family. When variables are defined
for the terminal, the \fBA_ALTCHARSET\fR bit is turned on. (See
\fBcurs_attr\fR(3CURSES)). Otherwise, the default character listed below is
stored in the variable. The names chosen are consistent with the VT100
nomenclature.
.sp

.sp
.TS
box;
c | c | c
l | l | l .
Name	Default	Glyph Description
_
ACS_ULCORNER	+	upper left-hand corner
_
ACS_LLCORNER	+	lower left-hand corner
_
ACS_URCORNER	+	upper right-hand corner
_
ACS_LRCORNER	+	lower right-hand corner
_
ACS_RTEE	+	right tee
_
ACS_LTEE	+	left tee
_
ACS_BTEE	+	bottom tee
_
ACS_TTEE	+	top tee
_
ACS_HLINE	-	horizontal line
_
ACS_VLINE	|	vertical line
_
ACS_PLUS	+	plus
_
ACS_S1	-	scan line 1
_
ACS_S9	-	scan line 9
_
ACS_DIAMOND	+	diamond
_
ACS_CKBOARD	:	checker board (stipple)
_
ACS_DEGREE	\&'	degree symbol
_
ACS_PLMINUS	#	plus/minus
_
ACS_BULLET	o	bullet
_
ACS_LARROW	<	arrow pointing left
_
ACS_RARRROW	>	arrow pointing right
_
ACS_DARROW	v	arrow pointing down
_
ACS_UARROW	^	arrow pointing up
_
ACS_BOARD	#	board of squares
_
ACS_LANTERN	#	lantern symbol
_
ACS_BLOCK	#	solid square block
.TE

.SH RETURN VALUE
.sp
.LP
All routines return the integer \fBERR\fR upon failure and an integer value
other than \fBERR\fR upon successful completion, unless otherwise noted in the
preceding routine descriptions.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
MT-Level	Unsafe
.TE

.SH SEE ALSO
.sp
.LP
\fBputwchar\fR(3C), \fBclrtoeol\fR(3CURSES), \fBcurses\fR(3CURSES),
\fBcurs_attr\fR(3CURSES), \fBcurs_inwch\fR(3CURSES),
\fBcurs_outopts\fR(3CURSES), \fBrefresh\fR(3CURSES), \fBstandout\fR(3CURSES),
\fBwinwch\fR(3CURSES), \fBwrefresh\fR(3CURSES), \fBattributes\fR(5)
.SH NOTES
.sp
.LP
The header file <\fBcurses.h\fR> automatically includes the header files
<\fBstdio.h\fR>, <\fBunctrl.h\fR> and <\fBwidec.h\fR>.
.sp
.LP
Note that  \fBaddwch()\fR,\fB mvaddwch()\fR, \fBmvwaddwch()\fR, and
\fBechowchar()\fR may be macros.
.sp
.LP
None of these routines can use the color attribute in \fBchtype\fR.