]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_addch.3x
ncurses 5.2
[ncurses.git] / man / curs_addch.3x
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998,2000 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 .\"
30 .\" $Id: curs_addch.3x,v 1.17 2000/07/01 19:53:01 tom Exp $
31 .TH curs_addch 3X ""
32 .SH NAME
33 \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR,
34 \fBechochar\fR,
35 \fBwechochar\fR - add a character (with attributes) to a \fBcurses\fR window, then advance the cursor
36 .SH SYNOPSIS
37 \fB#include <curses.h>\fR
38
39 \fBint addch(chtype ch);\fR
40 .br
41 \fBint waddch(WINDOW *win, chtype ch);\fR
42 .br
43 \fBint mvaddch(int y, int x, chtype ch);\fR
44 .br
45 \fBint mvwaddch(WINDOW *win, int y, int x, chtype ch);\fR
46 .br
47 \fBint echochar(chtype ch);\fR
48 .br
49 \fBint wechochar(WINDOW *win, chtype ch);\fR
50 .br
51 .SH DESCRIPTION
52 The \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR and \fBmvwaddch\fR routines put
53 the character \fIch\fR into the given window at its current window position,
54 which is then advanced.  They are analogous to \fBputchar\fR in \fBstdio\fR(3).
55 If the advance is at the right margin, the cursor automatically wraps to the
56 beginning of the next line.  At the bottom of the current scrolling region, if
57 \fBscrollok\fR is enabled, the scrolling region is scrolled up one line.
58
59 If \fIch\fR is a tab, newline, or backspace, the cursor is moved appropriately
60 within the window.  Backspace moves the cursor one character left; at the left
61 edge of a window it does nothing.  Newline does a \fBclrtoeol\fR, then moves
62 the cursor to the window left margin on the next line, scrolling the window if
63 on the last line).  Tabs are considered to be at every eighth column.
64
65 If \fIch\fR is any control character other than tab, newline, or backspace, it
66 is drawn in \fB^\fR\fIX\fR notation.  Calling \fBwinch\fR after adding a
67 control character does not return the character itself, but instead returns
68 the ^-representation of the control character.
69
70 Video attributes can be combined with a character argument passed to
71 \fBaddch\fR or related functions by logical-ORing them into the character.
72 (Thus, text, including attributes, can be copied from one place to another
73 using \fBinch\fR and \fBaddch\fR.).  See the \fBcurs_attr\fR(3X) page for
74 values of predefined video attribute constants that can be usefully OR'ed
75 into characters.
76
77 The \fBechochar\fR and \fBwechochar\fR routines are equivalent to a call to
78 \fBaddch\fR followed by a call to \fBrefresh\fR, or a call to \fBwaddch\fR
79 followed by a call to \fBwrefresh\fR.  The knowledge that only a single
80 character is being output is used and, for non-control characters, a
81 considerable performance gain may be seen by using these routines instead of
82 their equivalents.
83 .SS Line Graphics
84 The following variables may be used to add line drawing characters to the
85 screen with routines of the \fBaddch\fR family.  The default character listed
86 below is used if the \fBacsc\fR capability doesn't define a terminal-specific
87 replacement for it (but see the EXTENSIONS section below).  The names are
88 taken from VT100 nomenclature.
89
90 .TS
91 l l l
92 _ _ _
93 l l l.
94 \fIName\fR      \fIDefault\fR   \fIDescription\fR
95 ACS_BLOCK       #       solid square block
96 ACS_BOARD       #       board of squares
97 ACS_BTEE        +       bottom tee
98 ACS_BULLET      o       bullet
99 ACS_CKBOARD     :       checker board (stipple)
100 ACS_DARROW      v       arrow pointing down
101 ACS_DEGREE      '       degree symbol
102 ACS_DIAMOND     +       diamond
103 ACS_GEQUAL      >       greater-than-or-equal-to
104 ACS_HLINE       -       horizontal line
105 ACS_LANTERN     #       lantern symbol
106 ACS_LARROW      <       arrow pointing left
107 ACS_LEQUAL      <       less-than-or-equal-to
108 ACS_LLCORNER    +       lower left-hand corner
109 ACS_LRCORNER    +       lower right-hand corner
110 ACS_LTEE        +       left tee
111 ACS_NEQUAL      !       not-equal
112 ACS_PI  *       greek pi
113 ACS_PLMINUS     #       plus/minus
114 ACS_PLUS        +       plus
115 ACS_RARROW      >       arrow pointing right
116 ACS_RTEE        +       right tee
117 ACS_S1  -       scan line 1
118 ACS_S3  -       scan line 3
119 ACS_S7  -       scan line 7
120 ACS_S9  \&_     scan line 9
121 ACS_STERLING    f       pound-sterling symbol
122 ACS_TTEE        +       top tee
123 ACS_UARROW      ^       arrow pointing up
124 ACS_ULCORNER    +       upper left-hand corner
125 ACS_URCORNER    +       upper right-hand corner
126 ACS_VLINE       |       vertical line
127 .TE
128
129 .SH RETURN VALUE
130 All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success
131 (the SVr4 manuals specify only "an integer value other than \fBERR\fR") upon
132 successful completion, unless otherwise noted in the preceding routine
133 descriptions.
134 .SH NOTES
135 Note that \fBaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR, and
136 \fBechochar\fR may be macros.
137 .SH PORTABILITY
138 All these functions are described in the XSI Curses standard, Issue 4.
139 The defaults specified for forms-drawing characters apply in the POSIX locale.
140
141 Some ACS symbols
142 (ACS_S3,
143 ACS_S7,
144 ACS_LEQUAL,
145 ACS_GEQUAL,
146 ACS_PI,
147 ACS_NEQUAL,
148 ACS_STERLING)
149 were not documented in
150 any publicly released System V.  However, many publicly available terminfos
151 include \fBacsc\fR strings in which their key characters (pryz{|}) are
152 embedded, and a second-hand list of their character descriptions has come
153 to light.  The ACS-prefixed names for them were invented for \fBncurses\fR(3X).
154 .SH SEE ALSO
155 \fBcurses\fR(3X), \fBcurs_attr\fR(3X), \fBcurs_clear\fR(3X),
156 \fBcurs_inch\fR(3X), \fBcurs_outopts\fR(3X), \fBcurs_refresh\fR(3X),
157 \fBputc\fR(3S).
158 .\"#
159 .\"# The following sets edit modes for GNU EMACS
160 .\"# Local Variables:
161 .\"# mode:nroff
162 .\"# fill-column:79
163 .\"# End: