Debian Codegraph @

upstream/opensuse-leap-16-1/man3/add_wch.3ncurses

raw
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2019-2024,2025 Thomas E. Dickey *
4 .\" Copyright 2001-2015,2017 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 .\"
31 .\" $Id: curs_add_wch.3x,v 1.115 2025/04/19 22:53:52 tom Exp $
32 .TH add_wch 3NCURSES 2025-04-19 "ncurses 6.5" "Library calls"
33 .ie \n(.g \{\
34 .ds `` \(lq
35 .ds '' \(rq
36 .\}
37 .el \{\
38 .ie t .ds `` ``
39 .el .ds `` ""
40 .ie t .ds '' ''
41 .el .ds '' ""
42 .\}
43 .
44 .de bP
45 .ie n .IP \(bu 4
46 .el .IP \(bu 2
47 ..
48 .SH NAME
49 \fB\%add_wch\fP,
50 \fB\%wadd_wch\fP,
51 \fB\%mvadd_wch\fP,
52 \fB\%mvwadd_wch\fP,
53 \fB\%echo_wchar\fP,
54 \fB\%wecho_wchar\fP \-
55 add a \fIcurses\fR complex character to a window, possibly advancing the cursor
56 .SH SYNOPSIS
57 .nf
58 \fB#include <ncursesw/curses.h>
59 .PP
60 \fBint add_wch(const cchar_t * \fIwch\fP);
61 \fBint wadd_wch(WINDOW * \fIwin\fP, const cchar_t * \fIwch\fP);
62 \fBint mvadd_wch(int \fIy\fP, int \fIx\fP, const cchar_t * \fIwch\fP);
63 \fBint mvwadd_wch(WINDOW * \fIwin\fP, int \fIy\fP, int \fIx\fP,
64 const cchar_t * \fIwch\fP);
65 .PP
66 \fBint echo_wchar(const cchar_t * \fIwch\fP);
67 \fBint wecho_wchar(WINDOW * \fIwin\fP, const cchar_t *\fIwch\fP);
68 .PP
69 \fI/* (integer) constants */\fP
70 /*\fI .\|.\|. */ \fBWACS_BLOCK;\fR
71 /*\fI .\|.\|. */ \fBWACS_BOARD;\fR
72 /*\fI .\|.\|. */ \fBWACS_BTEE;\fR
73 /*\fI .\|.\|. */ \fBWACS_BULLET;\fR
74 /*\fI .\|.\|. */ \fBWACS_CKBOARD;\fR
75 /*\fI .\|.\|. */ \fBWACS_DARROW;\fR
76 /*\fI .\|.\|. */ \fBWACS_DEGREE;\fR
77 /*\fI .\|.\|. */ \fBWACS_DIAMOND;\fR
78 /*\fI .\|.\|. */ \fBWACS_HLINE;\fR
79 /*\fI .\|.\|. */ \fBWACS_LANTERN;\fR
80 /*\fI .\|.\|. */ \fBWACS_LARROW;\fR
81 /*\fI .\|.\|. */ \fBWACS_LLCORNER;\fR
82 /*\fI .\|.\|. */ \fBWACS_LRCORNER;\fR
83 /*\fI .\|.\|. */ \fBWACS_LTEE;\fR
84 /*\fI .\|.\|. */ \fBWACS_PLMINUS;\fR
85 /*\fI .\|.\|. */ \fBWACS_PLUS;\fR
86 /*\fI .\|.\|. */ \fBWACS_RARROW;\fR
87 /*\fI .\|.\|. */ \fBWACS_RTEE;\fR
88 /*\fI .\|.\|. */ \fBWACS_S1;\fR
89 /*\fI .\|.\|. */ \fBWACS_S9;\fR
90 /*\fI .\|.\|. */ \fBWACS_TTEE;\fR
91 /*\fI .\|.\|. */ \fBWACS_UARROW;\fR
92 /*\fI .\|.\|. */ \fBWACS_ULCORNER;\fR
93 /*\fI .\|.\|. */ \fBWACS_URCORNER;\fR
94 /*\fI .\|.\|. */ \fBWACS_VLINE;\fR
95 \fI/* extensions */\fP
96 /*\fI .\|.\|. */ \fBWACS_GEQUAL;\fR
97 /*\fI .\|.\|. */ \fBWACS_LEQUAL;\fR
98 /*\fI .\|.\|. */ \fBWACS_NEQUAL;\fR
99 /*\fI .\|.\|. */ \fBWACS_PI;\fR
100 /*\fI .\|.\|. */ \fBWACS_S3;\fR
101 /*\fI .\|.\|. */ \fBWACS_S7;\fR
102 /*\fI .\|.\|. */ \fBWACS_STERLING;\fR
103 \fI/* extensions for thick lines */\fP
104 /*\fI .\|.\|. */ \fBWACS_T_BTEE;\fR
105 /*\fI .\|.\|. */ \fBWACS_T_HLINE;\fR
106 /*\fI .\|.\|. */ \fBWACS_T_LLCORNER;\fR
107 /*\fI .\|.\|. */ \fBWACS_T_LRCORNER;\fR
108 /*\fI .\|.\|. */ \fBWACS_T_LTEE;\fR
109 /*\fI .\|.\|. */ \fBWACS_T_PLUS;\fR
110 /*\fI .\|.\|. */ \fBWACS_T_RTEE;\fR
111 /*\fI .\|.\|. */ \fBWACS_T_TTEE;\fR
112 /*\fI .\|.\|. */ \fBWACS_T_ULCORNER;\fR
113 /*\fI .\|.\|. */ \fBWACS_T_URCORNER;\fR
114 /*\fI .\|.\|. */ \fBWACS_T_VLINE;\fR
115 \fI/* extensions for double lines */\fP
116 /*\fI .\|.\|. */ \fBWACS_D_BTEE;\fR
117 /*\fI .\|.\|. */ \fBWACS_D_HLINE;\fR
118 /*\fI .\|.\|. */ \fBWACS_D_LLCORNER;\fR
119 /*\fI .\|.\|. */ \fBWACS_D_LRCORNER;\fR
120 /*\fI .\|.\|. */ \fBWACS_D_LTEE;\fR
121 /*\fI .\|.\|. */ \fBWACS_D_PLUS;\fR
122 /*\fI .\|.\|. */ \fBWACS_D_RTEE;\fR
123 /*\fI .\|.\|. */ \fBWACS_D_TTEE;\fR
124 /*\fI .\|.\|. */ \fBWACS_D_ULCORNER;\fR
125 /*\fI .\|.\|. */ \fBWACS_D_URCORNER;\fR
126 /*\fI .\|.\|. */ \fBWACS_D_VLINE;\fR
127 .fi
128 .SH DESCRIPTION
129 .SS wadd_wch
130 .B \%wadd_wch
131 writes the
132 .I curses
133 complex character
134 .I wch
135 to the window
136 .IR win ","
137 then may advance the cursor position,
138 analogously to the standard C library's \fI\%putwchar\fP(3).
139 \fB\%ncurses\fP(3NCURSES) describes the variants of this function.
140 .PP
141 Construct a
142 .I curses
143 complex character
144 from a
145 .I wchar_t
146 with \fB\%setcchar\fP(3NCURSES).
147 A
148 .I \%cchar_t
149 can be copied from place to place using \fB\%win_wch\fP(3NCURSES) and
150 .BR \%wadd_wch "."
151 See \fB\%attr\fP(3NCURSES) for values of predefined constants that can be
152 usefully \*(``or\*(''ed with characters.
153 A complex character whose only character component is a wide space,
154 and whose only attribute is
155 .BR \%WA_NORMAL ,
156 is a
157 .IR "blank character" ","
158 and therefore combines with the window's background character;
159 see \fB\%bkgrnd\fP(3NCURSES).
160 .PP
161 Much behavior depends on whether the wide characters in
162 .I wch
163 are spacing or non-spacing;
164 see subsection \*(``Complex Characters\*('' below.
165 .bP
166 If
167 .I wch
168 contains a spacing character,
169 then any character at the cursor is first removed.
170 The complex character
171 .IR wch ","
172 with its attributes and color pair identifier,
173 becomes the
174 .I base
175 of the
176 .IR "active complex character" "."
177 .bP
178 If
179 .I wch
180 contains only non-spacing characters,
181 .\" XXX: see wadd_wch_literal (the beginning of the array may be
182 .\" nonspacing)
183 they are combined with the active complex character.
184 .I curses
185 ignores its attributes and color pair identifier,
186 and does not advance the cursor.
187 .PP
188 Further non-spacing characters added with
189 .B \%wadd_wch
190 are not written at the new cursor position but combine with the active
191 complex character until another spacing character is written to the
192 window or the cursor is moved.
193 .PP
194 If
195 .I wch
196 is a
197 backspace,
198 carriage return,
199 line feed,
200 or
201 tab,
202 the cursor moves appropriately within the window.
203 .bP
204 Backspace moves the cursor one character left;
205 at the left margin of a window,
206 it does nothing.
207 .bP
208 Carriage return moves the cursor to the left margin on the same line of
209 the window.
210 .bP
211 Line feed does a \fB\%clrtoeol\fP(3NCURSES),
212 then advances as if from the right margin.
213 .bP
214 Tab advances the cursor to the next tab stop
215 (possibly on the next line);
216 these are placed at every eighth column by default.
217 .IP
218 Alter the tab interval with the
219 .B \%TABSIZE
220 extension;
221 see \fB\%curses_variables\fP(3NCURSES).
222 .PP
223 If
224 .I wch
225 is any other nonprintable character,
226 it is drawn in printable form using the same convention as
227 \fB\%wunctrl\fP(3NCURSES).
228 Calling \fB\%win_wch\fP(3NCURSES) on the location of a nonprintable character
229 does not return the character itself,
230 but its \fB\%wunctrl\fP(3NCURSES) representation.
231 .PP
232 Adding spacing characters with \fB\%wadd_wch\fP
233 causes it to wrap at the right margin of the window:
234 .bP
235 If the cursor is not at the bottom of the scrolling region
236 and advancement occurs at the right margin,
237 the cursor automatically wraps to the beginning of the next line.
238 .bP
239 If the cursor is at the bottom of the scrolling region
240 when advancement occurs at the right margin,
241 and \fB\%scrollok\fP(3NCURSES) is enabled for
242 .IR win ,
243 the scrolling region scrolls up one line
244 and the cursor wraps as above.
245 Otherwise,
246 advancement and scrolling do not occur,
247 and
248 .B \%wadd_wch
249 returns
250 .BR ERR "."
251 .PP
252 A window's margins may coincide with the screen boundaries.
253 This may be a problem when
254 .I \%ncurses
255 updates the screen to match the curses window.
256 When their right and bottom margins coincide,
257 .I \%ncurses
258 uses different strategies to handle the variations of scrolling and wrapping
259 at the lower-right corner
260 by depending on the terminal capabilities:
261 .bP
262 If the terminal does not automatically wrap as characters
263 are added at the right margin
264 (i.e., auto right margins),
265 .I \%ncurses
266 writes the character directly.
267 .bP
268 If the terminal has auto right margins,
269 but also has capabilities for turning auto margins off and on,
270 .I \%ncurses
271 turns the auto margin feature off temporarily
272 when writing to the lower-right corner.
273 .bP
274 If the terminal has an insertion mode which can be turned off and on,
275 .I \%ncurses
276 writes the character just before the lower-right corner,
277 and then inserts a character to push the update into the corner.
278 .SS wecho_wchar
279 .B \%echo_wchar
280 and
281 .B \%wecho_wchar
282 are equivalent to calling
283 .RB \%( w ) add_wch
284 followed by
285 .RB \%( w ) refresh
286 on
287 .B \%stdscr
288 or the specified window.
289 .I curses
290 interprets these functions as a hint that only a single (complex)
291 character is being output;
292 for non-control characters,
293 a considerable performance gain may be enjoyed by employing them.
294 .\" TODO: Combine the following with the "Line Drawing" subsection of
295 .\" terminfo(5) and replace this with a cross reference there.
296 .SS "Forms-Drawing Characters"
297 .I curses
298 defines macros starting with
299 .B \%WACS_
300 that can be used with
301 .B \%wadd_wch
302 to write line-drawing and other symbols to the screen.
303 .I \%ncurses
304 terms these
305 .I "forms-drawing characters."
306 .I curses
307 uses the ACS default listed below if the terminal type lacks the
308 .B \%acs_chars
309 .RB \%( acsc )
310 capability;
311 that capability does not define a replacement for the character;
312 or if the terminal type and locale configuration
313 require Unicode to access these characters,
314 but the library is unable to use Unicode.
315 The \*(``acsc char\*('' column corresponds to how the characters are
316 specified in the
317 .B \%acs_chars
318 .RB \%( acsc )
319 string capability,
320 and the characters in it may appear on the screen if the terminal type's
321 database entry incorrectly advertises ACS support.
322 The name \*(``ACS\*('' originates in the Alternate Character Set feature
323 of the DEC VT100 terminal.
324 .PP
325 .ie t .ne 4v
326 .el .ne 5v
327 .TS
328 Lb Lb Lb Lb Lb
329 Lb Lb Lb Lb Lb
330 Lb L L L Lx.
331 \& Unicode ACS acsc \&
332 Symbol Default Default char Glyph Name
333 _
334 WACS_BLOCK U+25ae # 0 T{
335 solid square block
336 T}
337 WACS_BOARD U+2592 # h board of squares
338 WACS_BTEE U+2534 + v bottom tee
339 WACS_BULLET U+00b7 o ~ bullet
340 WACS_CKBOARD U+2592 : a T{
341 checker board (stipple)
342 T}
343 WACS_DARROW U+2193 v . T{
344 arrow pointing down
345 T}
346 WACS_DEGREE U+00b0 ' f degree symbol
347 WACS_DIAMOND U+25c6 + \(ga diamond
348 WACS_GEQUAL U+2265 > > T{
349 .if n .na \" avoid adjustment warning from groff
350 greater-than-or-equal-to
351 T}
352 WACS_HLINE U+2500 \- q horizontal line
353 WACS_LANTERN U+2603 # i lantern symbol
354 WACS_LARROW U+2190 < , T{
355 arrow pointing left
356 T}
357 WACS_LEQUAL U+2264 < y T{
358 .if n .na \" avoid adjustment warning from groff
359 less-than-or-equal-to
360 T}
361 WACS_LLCORNER U+2514 + m T{
362 lower left-hand corner
363 T}
364 WACS_LRCORNER U+2518 + j T{
365 lower right-hand corner
366 T}
367 WACS_LTEE U+2524 + t left tee
368 WACS_NEQUAL U+2260 ! | not-equal
369 WACS_PI U+03c0 * { greek pi
370 WACS_PLMINUS U+00b1 # g plus/minus
371 WACS_PLUS U+253c + n plus
372 WACS_RARROW U+2192 > + T{
373 arrow pointing right
374 T}
375 WACS_RTEE U+251c + u right tee
376 WACS_S1 U+23ba \- o scan line 1
377 WACS_S3 U+23bb \- p scan line 3
378 WACS_S7 U+23bc \- r scan line 7
379 WACS_S9 U+23bd \&_ s scan line 9
380 WACS_STERLING U+00a3 f } T{
381 .if n .na \" avoid adjustment warning from groff
382 pound-sterling symbol
383 T}
384 WACS_TTEE U+252c + w top tee
385 WACS_UARROW U+2191 ^ \- T{
386 arrow pointing up
387 T}
388 WACS_ULCORNER U+250c + l T{
389 upper left-hand corner
390 T}
391 WACS_URCORNER U+2510 + k T{
392 upper right-hand corner
393 T}
394 WACS_VLINE U+2502 | x vertical line
395 .TE
396 .PP
397 The
398 .I \%ncurses
399 wide API also defines symbols for thick lines
400 .RB \%( acsc
401 \*(``J\*('' through \*(``N\*('',
402 \*(``T\*('' through \*(``X\*('',
403 and \*(``Q\*(''):
404 .PP
405 .TS
406 Lb Lb Lb Lb Lb
407 Lb Lb Lb Lb Lb
408 Lb L L L Lx.
409 \& Unicode ASCII acsc \&
410 ACS Name Default Default Char Glyph Name
411 _
412 WACS_T_BTEE U+253b + V T{
413 thick tee pointing up
414 T}
415 WACS_T_HLINE U+2501 - Q T{
416 thick horizontal line
417 T}
418 WACS_T_LLCORNER U+2517 + M T{
419 thick lower left corner
420 T}
421 WACS_T_LRCORNER U+251b + J T{
422 thick lower right corner
423 T}
424 WACS_T_LTEE U+252b + T T{
425 thick tee pointing right
426 T}
427 WACS_T_PLUS U+254b + N T{
428 thick large plus
429 T}
430 WACS_T_RTEE U+2523 + U T{
431 thick tee pointing left
432 T}
433 WACS_T_TTEE U+2533 + W T{
434 thick tee pointing down
435 T}
436 WACS_T_ULCORNER U+250f + L T{
437 thick upper left corner
438 T}
439 WACS_T_URCORNER U+2513 + K T{
440 thick upper right corner
441 T}
442 WACS_T_VLINE U+2503 | X T{
443 thick vertical line
444 T}
445 .TE
446 .PP
447 and for double lines
448 .RB \%( acsc
449 \*(``A\*('' through \*(``I\*('',
450 plus \*(``R\*('' and \*(``Y\*(''):
451 .PP
452 .TS
453 Lb Lb Lb Lb Lb
454 Lb Lb Lb Lb Lb
455 Lb L L L Lx.
456 \& Unicode ASCII acsc \&
457 ACS Name Default Default Char Glyph Name
458 _
459 WACS_D_BTEE U+2569 + H T{
460 double tee pointing up
461 T}
462 WACS_D_HLINE U+2550 - R T{
463 double horizontal line
464 T}
465 WACS_D_LLCORNER U+255a + D T{
466 double lower left corner
467 T}
468 WACS_D_LRCORNER U+255d + A T{
469 double lower right corner
470 T}
471 WACS_D_LTEE U+2560 + F T{
472 double tee pointing right
473 T}
474 WACS_D_PLUS U+256c + E T{
475 double large plus
476 T}
477 WACS_D_RTEE U+2563 + G T{
478 double tee pointing left
479 T}
480 WACS_D_TTEE U+2566 + I T{
481 double tee pointing down
482 T}
483 WACS_D_ULCORNER U+2554 + C T{
484 double upper left corner
485 T}
486 WACS_D_URCORNER U+2557 + B T{
487 double upper right corner
488 T}
489 WACS_D_VLINE U+2551 | Y T{
490 double vertical line
491 T}
492 .TE
493 .PP
494 Unicode's descriptions for these characters differs slightly from
495 \fI\%ncurses\fP,
496 by introducing the term \*(``light\*('' (along with less important details).
497 Here are its descriptions for the normal, thick, and double horizontal lines:
498 .bP
499 U+2500 BOX DRAWINGS LIGHT HORIZONTAL
500 .bP
501 U+2501 BOX DRAWINGS HEAVY HORIZONTAL
502 .bP
503 U+2550 BOX DRAWINGS DOUBLE HORIZONTAL
504 .SH RETURN VALUE
505 These functions return
506 .B OK
507 on success and
508 .B ERR
509 on failure.
510 .PP
511 In
512 .IR \%ncurses ,
513 these functions fail if
514 .bP
515 the
516 .I curses
517 screen has not been initialized,
518 .bP
519 (for functions taking a
520 .I \%WINDOW
521 pointer argument)
522 .I win
523 is a null pointer,
524 .bP
525 wrapping to a new line is impossible because \fB\%scrollok\fP(3NCURSES) has
526 not been called on
527 .I win
528 (or
529 .BR \%stdscr ","
530 as applicable)
531 when writing to its bottom right location is attempted,
532 or
533 .bP
534 it is not possible to add a complete character at the cursor position.
535 .PP
536 Functions prefixed with \*(``mv\*('' first perform cursor movement and
537 fail if the position
538 .RI ( y ,
539 .IR x )
540 is outside the window boundaries.
541 .SH NOTES
542 .BR add_wch ","
543 .BR mvadd_wch ","
544 .BR mvwadd_wch ","
545 and
546 .B echo_wchar
547 may be implemented as macros.
548 .SH EXTENSIONS
549 The symbols
550 .IR \%WACS_S3 ","
551 .IR \%WACS_S7 ","
552 .IR \%WACS_LEQUAL ","
553 .IR \%WACS_GEQUAL ","
554 .IR \%WACS_PI ","
555 .IR \%WACS_NEQUAL ","
556 and
557 .I \%WACS_STERLING
558 are not standard.
559 However,
560 many publicly available
561 .I \%term\%info
562 entries include
563 .B \%acs_chars
564 .RB \%( acsc )
565 capabilities in which their key characters
566 .RB ( pryz{|} )
567 are embedded,
568 and a second-hand list of their character descriptions has come to
569 light.
570 The
571 .I \%ncurses
572 developers invented WACS-prefixed names for them.
573 .\" in v5_2_20020209
574 .SH PORTABILITY
575 Applications employing
576 .I \%ncurses
577 extensions should condition their use on the visibility of the
578 .B \%NCURSES_VERSION
579 preprocessor macro.
580 .PP
581 These functions are described in X/Open Curses Issue\ 4.
582 It specifies no error conditions for them.
583 .PP
584 The defaults specified for forms-drawing characters apply in the POSIX
585 locale.
586 X/Open Curses makes it clear that the WACS_ symbols should be defined as
587 a pointer to
588 .I \%cchar_t
589 data, e.g., in the discussion of
590 .IR \%border_set "."
591 A few implementations are problematic:
592 .bP
593 NetBSD
594 .I curses
595 defines the symbols as a
596 .I \%wchar_t
597 within a
598 .IR \%cchar_t "."
599 .bP
600 HP-UX
601 .I curses
602 equates some of the
603 .I \%ACS_
604 symbols to the analogous
605 .I \%WACS_
606 symbols as if the
607 .I \%ACS_
608 symbols were
609 wide characters.
610 The misdefined symbols are the arrows
611 and other symbols which are not used for line-drawing.
612 .PP
613 X/Open Curses does not specify symbols for thick- or double-lines.
614 SVr4
615 .I curses
616 implementations defined their line-drawing symbols
617 in terms of intermediate symbols.
618 .I \%ncurses
619 extends those symbols,
620 providing new definitions not found in SVr4 implementations.
621 .PP
622 Not all Unicode-capable terminals provide support for VT100-style
623 alternate character sets (i.e., the
624 .I \%acsc_chars
625 .RB ( acsc )
626 capability),
627 with their corresponding line-drawing characters.
628 X/Open Curses did not address the aspect of integrating Unicode with
629 line-drawing characters.
630 Existing implementations of System\ V
631 .I curses
632 (AIX, HP-UX, Solaris)
633 use only the
634 .I \%acsc_chars
635 .RB ( acsc )
636 character-mapping to provide this feature.
637 As a result,
638 those implementations can use only single-byte line-drawing characters.
639 .I \%ncurses
640 5.3 (2002) provided a table of Unicode values to solve
641 these problems.
642 NetBSD
643 .I curses
644 incorporated that table in 2010.
645 .PP
646 .I \%ncurses
647 uses the Unicode values instead of the terminal type description's
648 .I \%acsc_chars
649 .RB ( acsc )
650 mapping as discussed in
651 \fB\%ncurses\fP(3NCURSES) for the environment variable
652 .IR \%NCURSES_NO_UTF8_ACS "."
653 In contrast, for the same cases, the line-drawing characters
654 described in \fB\%addch\fP(3NCURSES) will use only the ASCII default values.
655 .PP
656 Having Unicode available does not solve all of the problems with
657 line-drawing for
658 .IR curses ":"
659 .bP
660 The closest Unicode equivalents to the
661 VT100 graphics
662 .IR S1 ","
663 .IR S3 ","
664 .IR S7 ","
665 and
666 .I S9
667 frequently are not displayed at
668 the regular intervals which the terminal used.
669 .bP
670 The
671 .I lantern
672 is a special case.
673 It originated with the AT&T 4410 terminal in the early 1980s.
674 There is no accessible documentation depicting the lantern symbol
675 on the AT&T terminal.
676 .IP
677 Lacking documentation, most readers assume that a
678 .I "storm lantern"
679 was intended.
680 But there are several possibilities, all with problems.
681 .IP
682 Unicode 6.0 (2010) does provide two lantern symbols: U+1F383 and U+1F3EE.
683 Those were not available in 2002,
684 and are irrelevant since they lie outside the Basic Multilingual Plane
685 and as a result are unavailable on many terminals.
686 They are not storm lanterns, in any case.
687 .IP
688 Most
689 .I "storm lanterns"
690 have a tapering glass chimney
691 (to guard against tipping);
692 some have a wire grid protecting the chimney.
693 .IP
694 For the tapering appearance, \[u2603] U+2603 was adequate.
695 In use on a terminal, no one can tell what the image represents.
696 Unicode calls it a snowman.
697 .IP
698 Others have suggested these alternatives:
699 \[sc] U+00A7 (section mark),
700 \[u0398] U+0398 (theta),
701 \[u03A6] U+03A6 (phi),
702 \[u03B4] U+03B4 (delta),
703 \[u2327] U+2327 (x in a rectangle),
704 \[u256C] U+256C (forms double vertical and horizontal), and
705 \[u2612] U+2612 (ballot box with x).
706 .SS "Complex Characters"
707 The complex character type
708 .I \%cchar_t
709 can store more than one wide character
710 .RI \%( wchar_t ).
711 X/Open Curses does not mention this possibility,
712 specifying behavior only where
713 .I wch
714 is a single character,
715 either spacing or non-spacing.
716 .PP
717 .I \%ncurses
718 assumes that
719 .I wch
720 is constructed using \fB\%setcchar\fP(3NCURSES),
721 and in turn that the result
722 .bP
723 contains at most one spacing character at the beginning of its list of
724 wide characters,
725 and zero or more non-spacing characters,
726 or
727 .bP
728 holds one non-spacing character.
729 .PP
730 In the latter case,
731 .I \%ncurses
732 adds the non-spacing character to the active complex character.
733 .SH HISTORY
734 X/Open Curses Issue\ 4 (1995) initially specified these functions.
735 The System\ V Interface Definition (SVID) Version\ 4
736 of the same year
737 specified functions named
738 .I \%waddwch
739 (and the usual variants),
740 .IR \%echowchar ","
741 and
742 .IR \%wechowchar "."
743 .\" SVID 4, vol 3., p. 475
744 These were later additions to
745 .RI SVr4. x ,
746 not appearing in the first SVr4 (1989).
747 They differed from X/Open's later
748 .I \%wadd_wch
749 and
750 .I \%wecho_wchar
751 in that they each took an argument of type
752 .I \%wchar_t
753 instead of
754 .IR \%cchar_t "."
755 SVID defined no
756 .I \% WACS_
757 symbols.
758 .PP
759 X/Open Curses Issue\ 4 also defined many of the
760 .I WACS_
761 constants,
762 excepting
763 .IR \%WACS_GEQUAL ","
764 .IR \%WACS_LEQUAL ","
765 .IR \%WACS_NEQUAL ","
766 .IR \%WACS_PI ","
767 .IR \%WACS_S3 ","
768 .IR \%WACS_S7 ","
769 and
770 .IR \%WACS_STERLING ";"
771 and those for drawing thick and double lines.
772 .PP
773 .I \%ncurses
774 5.3 (2002)
775 furnished the remaining
776 .I WACS_
777 constants.
778 .SH SEE ALSO
779 \fB\%addch\fP(3NCURSES) describes comparable functions of the
780 .I \%ncurses
781 library in its non-wide-character configuration.
782 .PP
783 \fB\%ncurses\fP(3NCURSES),
784 \fB\%addwstr\fP(3NCURSES),
785 \fB\%add_wchstr\fP(3NCURSES),
786 \fB\%attr\fP(3NCURSES),
787 \fB\%bkgrnd\fP(3NCURSES),
788 \fB\%clear\fP(3NCURSES),
789 \fB\%getcchar\fP(3NCURSES),
790 \fB\%outopts\fP(3NCURSES),
791 \fB\%refresh\fP(3NCURSES),
792 \fB\%curses_variables\fP(3NCURSES),
793 \fB\%putwc\fP(3)