curs_add_wch(3x) curs_add_wch(3x)
add_wch, wadd_wch, mvadd_wch, mvwadd_wch, echo_wchar,
wecho_wchar - add a complex character and rendition to a
curses window, then advance the cursor
- 複合文字とその色と属性を curses のウィンドウに追加し、
カーソルを進める
#include <curses.h>
int add_wch( const cchar_t *wch );
int wadd_wch( WINDOW *win, const cchar_t *wch );
int mvadd_wch( int y, int x, const cchar_t *wch );
int mvwadd_wch( WINDOW *win, int y, int x, const cchar_t
*wch );
int echo_wchar( const cchar_t *wch );
int wecho_wchar( WINDOW *win, const cchar_t *wch );
The add_wch, wadd_wch, mvadd_wch, and mvwadd_wch functions
put the complex character wch into the given window at its
current position, which is then advanced. These functions
perform wrapping and special-character processing as fol-
lows:
add_wch, wadd_wch, mvadd_wch, および mvwadd_wch の各
関数は、複合文字 wch を指定のウィンドウの現在位置に書き込ん
だ後、現在位置を進めます。
これらの関数は、行の折り返しと特殊文字の処理を次のように行
います。
o If wch refers to a spacing character, then any previ-
ous character at that location is removed. A new
character specified by wch is placed at that location
with rendition specified by wch. The cursor then
advances to the next spacing character on the screen.
o wch がスペーシング文字を指す場合は、その位置に以前から
あるどのような文字も削除されます。wch によって指定され
た新しい文字がその場所に wch で指定された色と属性で置か
れます。その後、カーソルを画面上の次のスペーシング文字
まで進めます。
o If wch refers to a non-spacing character, all previous
characters at that location are preserved. The non-
spacing characters of wch are added to the spacing
complex character, and the rendition specified by wch
is ignored.
o wch が非スペーシング文字を指す場合は、その位置に以前か
らあるどの文字も保存されます。wch の非スペーシング文字
はスペーシング複合文字に追加され、wch で指定された色と
属性は無視されます。
o If the character part of wch is a tab, newline,
backspace or other control character, the window is
updated and the cursor moves as if addch were called.
o wch の文字部分がタブ、改行、バックスペース、もしくは他
の制御文字の場合は、ウィンドウが更新され、カーソルは
addch が呼ばれたかのように移動します。
The echo_wchar function is functionally equivalent to a
call to add_wch followed by a call to refresh. Similarly,
the wecho_wchar is functionally equivalent to a call to
wadd_wch followed by a call to wrefresh. The knowledge
that only a single character is being output is taken into
consideration and, for non-control characters, a consider-
able performance gain might be seen by using the *echo*
functions instead of their equivalents.
echo_wchar 関数は、add_wch を呼んだ後に refresh を呼ぶこ
とと、機能的に同じです。同様に、wecho_wchar 関数は、
wadd_wch を呼んだ後に wrefresh を呼ぶことと、機能的に同じで
す。
1つの文字だけが出力されるという知識は考慮され、そして、非
制御文字に対しては、等価な関数よりも *echo* を使うことで相
当な性能の向上がみられることがあります。
Like curs_addch(3x), addch_wch accepts symbols which make it
simple to draw lines and other frequently used special
characters. These symbols correspond to the same VT100
line-drawing set as curs_addch(3x).
addch_wch は curs_addch(3x) のように、罫線を簡単に表示す
るための記号やその他のよく使われる特殊文字を受け入れます。
これらの記号は curs_addch(3x) と同じく、VT100 罫線素片集合
に対応しています。
Name Unicode Default Description
名前 Unicode デフォルト 説明
----------------------------------------------------------------
WACS_BLOCK 0x25ae # solid square block 正方形ボックス
WACS_BOARD 0x2592 # board of squares 矩形のボード
WACS_BTEE 0x2534 + bottom tee 下ティー
WACS_BULLET 0x00b7 o bullet 黒丸
WACS_CKBOARD 0x2592 : checker board (stipple) チェッカーボード(点描)
WACS_DARROW 0x2193 v arrow pointing down 下向き矢印
WACS_DEGREE 0x00b0 ' degree symbol 度記号
WACS_DIAMOND 0x25c6 + diamond ダイヤモンド
WACS_GEQUAL 0x2265 > greater-than-or-equal-to 以上(不等号)
WACS_HLINE 0x2500 - horizontal line 横線
WACS_LANTERN 0x2603 # lantern symbol ランタン記号
WACS_LARROW 0x2190 < arrow pointing left 左向き矢印
WACS_LEQUAL 0x2264 < less-than-or-equal-to 以下(不等号)
WACS_LLCORNER 0x2514 + lower left-hand corner 左下隅
WACS_LRCORNER 0x2518 + lower right-hand corner 右下隅
WACS_LTEE 0x2524 + left tee 左ティー
WACS_NEQUAL 0x2260 ! not-equal 等号否定
WACS_PI 0x03c0 * greek pi ギリシャ語のパイ
WACS_PLMINUS 0x00b1 # plus/minus プラス/マイナス
WACS_PLUS 0x253c + plus 罫線素片中央(十字形)
WACS_RARROW 0x2192 > arrow pointing right 右向き矢印
WACS_RTEE 0x251c + right tee 右ティー
WACS_S1 0x23ba - scan line 1 スキャンライン1
WACS_S3 0x23bb - scan line 3 スキャンライン3
WACS_S7 0x23bc - scan line 7 スキャンライン7
WACS_S9 0x23bd _ scan line 9 スキャンライン9
WACS_STERLING 0x00a3 f pound-sterling symbol ポンド記号
WACS_TTEE 0x252c + top tee 上ティー
WACS_UARROW 0x2191 ^ arrow pointing up 上向き矢印
WACS_ULCORNER 0x250c + upper left-hand corner 左上隅
WACS_URCORNER 0x2510 + upper right-hand corner 右上隅
WACS_VLINE 0x2502 | vertical line 縦線
The wide-character configuration of ncurses also defines
symbols for thick- and double-lines:
ncurses のワイド文字環境設定は、太線および二重線の記号も
定義しています。
Name Unicode Default Description
名前 Unicode デフォルト 説明
---------------------------------------------------------------------
WACS_T_ULCORNER 0x250f + thick upper left corner 太線左上隅
WACS_T_LLCORNER 0x2517 + thick lower left corner 太線左下隅
WACS_T_URCORNER 0x2513 + thick upper right corner 太線右上隅
WACS_T_LRCORNER 0x251b + thick lower right corner 太線右下隅
WACS_T_LTEE 0x252b + thick tee pointing right 太線左ティー
WACS_T_RTEE 0x2523 + thick tee pointing left 太線右ティー
WACS_T_BTEE 0x253b + thick tee pointing up 太線下ティー
WACS_T_TTEE 0x2533 + thick tee pointing down 太線上ティー
WACS_T_HLINE 0x2501 - thick horizontal line 太線横線
WACS_T_VLINE 0x2503 | thick vertical line 太線縦線
WACS_T_PLUS 0x254b + thick large plus or crossover 太線罫線素片中央(十字形)
WACS_D_ULCORNER 0x2554 + double upper left corner 二重左上隅
WACS_D_LLCORNER 0x255a + double lower left corner 二重左下隅
WACS_D_URCORNER 0x2557 + double upper right corner 二重右上隅
WACS_D_LRCORNER 0x255d + double lower right corner 二重右下隅
WACS_D_RTEE 0x2563 + double tee pointing left 二重右ティー
WACS_D_LTEE 0x2560 + double tee pointing right 二重左ティー
WACS_D_BTEE 0x2569 + double tee pointing up 二重下ティー
WACS_D_TTEE 0x2566 + double tee pointing down 二重上ティー
WACS_D_HLINE 0x2550 - double horizontal line 二重横線
WACS_D_VLINE 0x2551 | double vertical line 二重縦線
WACS_D_PLUS 0x256c + double large plus or crossover 二重罫線素片中央(十字形)
All routines return the integer ERR upon failure and OK on
success.
すべてのルーチンは、失敗すると整数 ERR を、成功すると OK
を返します。
Functions with a "mv" prefix first perform a cursor move-
ment using wmove, and return an error if the position is
outside the window, or if the window pointer is null.
mv で始まる関数は、最初に wmove を使用してカーソルを移動
し、位置がウィンドウの外だった場合、またはウィンドウポイン
タがヌルの場合にエラーを返します。
Note that add_wch, mvadd_wch, mvwadd_wch, and echo_wchar
may be macros.
add_wch, mvadd_wch, mvwadd_wch, および echo_wchar
はマクロであるかもしれないことに注意してください。
All of these functions are described in the XSI Curses
standard, Issue 4. The defaults specified for line-draw-
ing characters apply in the POSIX locale.
これらすべての関数は、 XSI Curses standard, Issue 4 に記
述されています。POSIX ロケールでは、罫線文字等に対して指
定されたデフォルトが適用されます。
X/Open Curses makes it clear that the WACS_ symbols should
be defined as a pointer to cchar_t data, e.g., in the dis-
cussion of border_set. A few implementations are problem-
atic:
X/Open Curses は、例えば border_setの議論で、 WACS_ 記号
は cchar_t 型データへのポインタとして定義するべきだとはっき
りさせています。
いくつかの実装は次のような問題の種をはらんでいます。
o NetBSD curses defines the symbols as a wchar_t within
a cchar_t.
o NetBSD curses は記号を cchar_t の中の wchar_t として定
義しています。
o HPUX curses equates some of the ACS_ symbols to the
analogous WACS_ symbols as if the ACS_ symbols were
wide characters. The misdefined symbols are the
arrows and other symbols which are not used for line-
drawing.
o HPUX curses はいくつかの ACS_ 記号を WACS_ 記号の類似物
として、あたかも ACS_ 記号がワイド文字であるかのように
同等視しています。定義を誤った記号は、罫線に使われない
矢印その他の記号です。
X/Open Curses does not define symbols for thick- or dou-
ble-lines. SVr4 curses implementations defined their
line-drawing symbols in terms of intermediate symbols.
This implementation extends those symbols, providing new
definitions which are not in the SVr4 implementations.
X/Open Curses は太線と二重線の記号を定義していません。
SVr4 curses の実装は罫線記号を中間記号の観点から定義してい
ます。この実装はこれらの記号を拡張し、SVr4 の実装とは異なる
新しい定義を与えています。
curses(3x), curs_addch(3x), curs_attr(3x), curs_clear(3x),
curs_outopts(3x), curs_refresh(3x), putwc(3)
curs_add_wch(3x)