Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2 | .\" Copyright (c) 2001-2012,2015 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | .\" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 29 | .\" $Id: curs_add_wch.3x,v 1.16 2015/07/20 23:44:56 tom Exp $ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 30 | .TH curs_add_wch 3X "" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 31 | .de bP |
| 32 | .IP \(bu 4 |
| 33 | .. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 34 | .SH NAME |
| 35 | \fBadd_wch\fP, |
| 36 | \fBwadd_wch\fP, |
| 37 | \fBmvadd_wch\fP, |
| 38 | \fBmvwadd_wch\fP, |
| 39 | \fBecho_wchar\fP, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 40 | \fBwecho_wchar\fP \- add a complex character and rendition to a \fBcurses\fR window, then advance the cursor |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 58 | .SS add_wch |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 59 | .PP |
| 60 | The |
| 61 | \fBadd_wch\fP, |
| 62 | \fBwadd_wch\fP, |
| 63 | \fBmvadd_wch\fP, and |
| 64 | \fBmvwadd_wch\fP |
| 65 | functions put the complex character \fIwch\fP into the given |
| 66 | window at its current position, |
| 67 | which is then advanced. |
| 68 | These functions perform |
| 69 | wrapping and special-character processing as follows: |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 70 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 71 | If \fIwch\fP refers to a spacing character, |
| 72 | then any previous character at that location is removed. |
| 73 | A new character specified by \fIwch\fP is |
| 74 | placed at that location with rendition specified by \fIwch\fP. |
| 75 | The cursor then advances to |
| 76 | the next spacing character on the screen. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 77 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 78 | If \fIwch\fP refers to a non-spacing character, |
| 79 | all previous characters at that location are preserved. |
| 80 | The non-spacing characters of \fIwch\fP |
| 81 | are added to the spacing complex character, |
| 82 | and the rendition specified by \fIwch\fP is ignored. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 83 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 84 | If the character part of \fIwch\fP is |
| 85 | a tab, newline, backspace or other control character, |
| 86 | the window is updated and the cursor moves as if \fBaddch\fR were called. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 87 | .SS echo_wchar |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 88 | .PP |
| 89 | The \fBecho_wchar\fP |
| 90 | function is functionally equivalent to a call to |
| 91 | \fBadd_wch\fP |
| 92 | followed by a call to |
| 93 | \fBrefresh\fP. |
| 94 | Similarly, the |
| 95 | \fBwecho_wchar\fP |
| 96 | is functionally equivalent to a call to |
| 97 | \fBwadd_wch\fP |
| 98 | followed by a call to |
| 99 | \fBwrefresh\fP. |
| 100 | The knowledge |
| 101 | that only a single character is being output is taken into consideration and, |
| 102 | for non-control characters, a considerable performance gain might be seen |
| 103 | by using the *\fBecho\fP* functions instead of their equivalents. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 104 | .SS Line Graphics |
| 105 | Like \fBaddch\fP(3X), |
| 106 | \fBaddch_wch\fP accepts symbols which make it simple to draw lines and other |
| 107 | frequently used special characters. |
| 108 | These symbols correspond to the same VT100 line-drawing set as |
| 109 | \fBaddch\fP(3X). |
| 110 | .PP |
| 111 | .TS |
| 112 | l l l l |
| 113 | _ _ _ _ |
| 114 | lw(1.5i) lw7 lw7 lw20. |
| 115 | \fIName\fR \fIUnicode\fP \fIDefault\fR \fIDescription\fR |
| 116 | WACS_BLOCK 0x25ae # solid square block |
| 117 | WACS_BOARD 0x2592 # board of squares |
| 118 | WACS_BTEE 0x2534 + bottom tee |
| 119 | WACS_BULLET 0x00b7 o bullet |
| 120 | WACS_CKBOARD 0x2592 : checker board (stipple) |
| 121 | WACS_DARROW 0x2193 v arrow pointing down |
| 122 | WACS_DEGREE 0x00b0 ' degree symbol |
| 123 | WACS_DIAMOND 0x25c6 + diamond |
| 124 | WACS_GEQUAL 0x2265 > greater-than-or-equal-to |
| 125 | WACS_HLINE 0x2500 \- horizontal line |
| 126 | WACS_LANTERN 0x2603 # lantern symbol |
| 127 | WACS_LARROW 0x2190 < arrow pointing left |
| 128 | WACS_LEQUAL 0x2264 < less-than-or-equal-to |
| 129 | WACS_LLCORNER 0x2514 + lower left-hand corner |
| 130 | WACS_LRCORNER 0x2518 + lower right-hand corner |
| 131 | WACS_LTEE 0x2524 + left tee |
| 132 | WACS_NEQUAL 0x2260 ! not-equal |
| 133 | WACS_PI 0x03c0 * greek pi |
| 134 | WACS_PLMINUS 0x00b1 # plus/minus |
| 135 | WACS_PLUS 0x253c + plus |
| 136 | WACS_RARROW 0x2192 > arrow pointing right |
| 137 | WACS_RTEE 0x251c + right tee |
| 138 | WACS_S1 0x23ba \- scan line 1 |
| 139 | WACS_S3 0x23bb \- scan line 3 |
| 140 | WACS_S7 0x23bc \- scan line 7 |
| 141 | WACS_S9 0x23bd \&_ scan line 9 |
| 142 | WACS_STERLING 0x00a3 f pound-sterling symbol |
| 143 | WACS_TTEE 0x252c + top tee |
| 144 | WACS_UARROW 0x2191 ^ arrow pointing up |
| 145 | WACS_ULCORNER 0x250c + upper left-hand corner |
| 146 | WACS_URCORNER 0x2510 + upper right-hand corner |
| 147 | WACS_VLINE 0x2502 | vertical line |
| 148 | .TE |
| 149 | .PP |
| 150 | The wide-character configuration of ncurses also defines symbols |
| 151 | for thick- and double-lines: |
| 152 | .PP |
| 153 | .TS |
| 154 | l l l l |
| 155 | _ _ _ _ |
| 156 | lw(1.5i) lw7 lw7 lw20. |
| 157 | \fIName\fR \fIUnicode\fP \fIDefault\fR \fIDescription\fR |
| 158 | WACS_T_ULCORNER 0x250f + thick upper left corner |
| 159 | WACS_T_LLCORNER 0x2517 + thick lower left corner |
| 160 | WACS_T_URCORNER 0x2513 + thick upper right corner |
| 161 | WACS_T_LRCORNER 0x251b + thick lower right corner |
| 162 | WACS_T_LTEE 0x252b + thick tee pointing right |
| 163 | WACS_T_RTEE 0x2523 + thick tee pointing left |
| 164 | WACS_T_BTEE 0x253b + thick tee pointing up |
| 165 | WACS_T_TTEE 0x2533 + thick tee pointing down |
| 166 | WACS_T_HLINE 0x2501 - thick horizontal line |
| 167 | WACS_T_VLINE 0x2503 | thick vertical line |
| 168 | WACS_T_PLUS 0x254b + thick large plus or crossover |
| 169 | WACS_D_ULCORNER 0x2554 + double upper left corner |
| 170 | WACS_D_LLCORNER 0x255a + double lower left corner |
| 171 | WACS_D_URCORNER 0x2557 + double upper right corner |
| 172 | WACS_D_LRCORNER 0x255d + double lower right corner |
| 173 | WACS_D_RTEE 0x2563 + double tee pointing left |
| 174 | WACS_D_LTEE 0x2560 + double tee pointing right |
| 175 | WACS_D_BTEE 0x2569 + double tee pointing up |
| 176 | WACS_D_TTEE 0x2566 + double tee pointing down |
| 177 | WACS_D_HLINE 0x2550 - double horizontal line |
| 178 | WACS_D_VLINE 0x2551 | double vertical line |
| 179 | WACS_D_PLUS 0x256c + double large plus or crossover |
| 180 | .TE |
| 181 | .SH RETURN VALUE |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 182 | .PP |
| 183 | All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 184 | .PP |
| 185 | Functions with a "mv" prefix first perform a cursor movement using |
| 186 | \fBwmove\fP, and return an error if the position is outside the window, |
| 187 | or if the window pointer is null. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 188 | .SH NOTES |
| 189 | .PP |
| 190 | Note that |
| 191 | \fBadd_wch\fP, |
| 192 | \fBmvadd_wch\fP, |
| 193 | \fBmvwadd_wch\fP, and |
| 194 | \fBecho_wchar\fP |
| 195 | may be macros. |
| 196 | .SH PORTABILITY |
| 197 | .PP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 198 | All of these functions are described in the XSI Curses standard, Issue 4. |
| 199 | The defaults specified for line-drawing characters apply in the POSIX locale. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 200 | .PP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 201 | X/Open Curses makes it clear that the WACS_ symbols should be defined as |
| 202 | a pointer to \fBcchar_t\fP data, e.g., in the discussion of \fBborder_set\fR. |
| 203 | A few implementations are problematic: |
| 204 | .bP |
| 205 | NetBSD curses defines the symbols as a \fBwchar_t\fP within a \fBcchar_t\fP. |
| 206 | .bP |
| 207 | HPUX curses equates some of the \fIACS_\fP symbols |
| 208 | to the analogous \fIWACS_\fP symbols as if the \fIACS_\fP symbols were |
| 209 | wide characters. |
| 210 | The misdefined symbols are the arrows |
| 211 | and other symbols which are not used for line-drawing. |
| 212 | .PP |
| 213 | X/Open Curses does not define symbols for thick- or double-lines. |
| 214 | SVr4 curses implementations defined their line-drawing symbols in |
| 215 | terms of intermediate symbols. |
| 216 | This implementation extends those symbols, providing new definitions |
| 217 | which are not in the SVr4 implementations. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 218 | .SH SEE ALSO |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 219 | .na |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 220 | .PP |
| 221 | \fBcurses\fR(3X), |
| 222 | \fBcurs_addch\fR(3X), |
| 223 | \fBcurs_attr\fR(3X), |
| 224 | \fBcurs_clear\fR(3X), |
| 225 | \fBcurs_outopts\fR(3X), |
| 226 | \fBcurs_refresh\fR(3X), |
| 227 | \fBputwc\fR(3) |