curs_pad(3x) curs_pad(3x)
newpad, subpad, prefresh, pnoutrefresh, pechochar,
pecho_wchar - create and display curses pads
pecho_wchar - curses パッドの作成と表示
#include <curses.h>
WINDOW *newpad(int nlines, int ncols);
WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
int begin_y, int begin_x);
int prefresh(WINDOW *pad, int pminrow, int pmincol,
int sminrow, int smincol, int smaxrow, int smaxcol);
int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,
int sminrow, int smincol, int smaxrow, int smaxcol);
int pechochar(WINDOW *pad, chtype ch);
int pecho_wchar(WINDOW *pad, const cchar_t *wch);
The newpad routine creates and returns a pointer to a new
pad data structure with the given number of lines, nlines,
and columns, ncols. A pad is like a window, except that
it is not restricted by the screen size, and is not neces-
sarily associated with a particular part of the screen.
Pads can be used when a large window is needed, and only a
part of the window will be on the screen at one time. Au-
tomatic refreshes of pads (e.g., from scrolling or echoing
of input) do not occur. It is not legal to call wrefresh
with a pad as an argument; the routines prefresh or
pnoutrefresh should be called instead. Note that these
routines require additional parameters to specify the part
of the pad to be displayed and the location on the screen
to be used for the display.
newpad ルーチンは、与えられた行数 nlines と桁数 ncols を持つ
新しいパッドのデータ構造を作り、ポインタを返します。
パッドはウインドウに似ていますが、画面のサイズに制限されず、
画面の特定の部分に対応付けられる必要もありません。
パッドは大きなウインドウが必要なときに使うことができ、
一度にウインドウの一部分のみが画面上に置かれます。
(例えばスクロールや入力のエコーによる) パッドの自動的な
更新は起こりません。
パッドを引数として wrefresh を呼び出すことは不正です。
代わりに prefresh か pnoutrefresh を呼び出さなければ
なりません。
これらのルーチンは、パッドのうち表示される部分と
表示する画面上の位置を指定する追加の引数を必要とすることに
注意してください。
The subpad routine creates and returns a pointer to a sub-
window within a pad with the given number of lines,
nlines, and columns, ncols. Unlike subwin, which uses
screen coordinates, the window is at position (begin_x,
begin_y) on the pad. The window is made in the middle of
the window orig, so that changes made to one window affect
both windows. During the use of this routine, it will of-
ten be necessary to call touchwin or touchline on orig be-
fore calling prefresh.
subpad ルーチンは、パッドの中に与えられた行数 nlines と
桁数 ncols を持つ子ウインドウを作り、ポインタを返します。
画面上の座標を用いる subwin と異なり、ウインドウはパッド上の
(begin_x, begin_y) に位置します。 (訳注: begin_y, begin_x か)
子ウインドウはウインドウ orig の中にできるので、
一方のウインドウへの変更は両方のウインドウに影響します。
このルーチンを使う間、 prefresh を呼び出す前にしばしば
orig に対して touchwin か touchline を呼び出す必要があります。
The prefresh and pnoutrefresh routines are analogous to
wrefresh and wnoutrefresh except that they relate to pads
instead of windows. The additional parameters are needed
to indicate what part of the pad and screen are involved.
The pminrow and pmincol parameters specify the upper left-
hand corner of the rectangle to be displayed in the pad.
The sminrow, smincol, smaxrow, and smaxcol parameters
specify the edges of the rectangle to be displayed on the
screen. The lower right-hand corner of the rectangle to
be displayed in the pad is calculated from the screen co-
ordinates, since the rectangles must be the same size.
Both rectangles must be entirely contained within their
respective structures. Negative values of pminrow, pmin-
col, sminrow, or smincol are treated as if they were zero.
prefresh と pnoutrefresh ルーチンは wrefresh と wnoutrefresh
に似ていますが、ウインドウではなくパッドに関係する点が
異なります。
パッドと画面のどの部分が対象となるかを示すために、
追加の引数が必要です。
引数 pminrow と pmincol はパッドのうち表示される長方形の
左上隅を指定します。
引数 sminrow, smincol, smaxrow, smaxcol は表示する画面上の
長方形の端の位置座標を指定します。
双方の長方形は同じサイズでなければならないので、パッドのうち
表示される長方形の右下隅の位置は、画面の座標から計算されます。
双方の長方形はそれぞれの構造に完全に含まれていなければ
なりません。
sminrow, smincol, smaxrow, smaxcol の負の値は、
ゼロであるかのように扱われます。
The pechochar routine is functionally equivalent to a call
to addch followed by a call to refresh, a call to waddch
followed by a call to wrefresh, or a call to waddch fol-
lowed by a call to prefresh. The knowledge that only a
single character is being output is taken into considera-
tion and, for non-control characters, a considerable per-
formance gain might be seen by using these routines in-
stead of their equivalents. In the case of pechochar, the
last location of the pad on the screen is reused for the
arguments to prefresh.
pechochar ルーチンは、 addch 呼び出しに続けて refresh を、
または waddch 呼び出しに続けて wrefresh を、
または waddch 呼び出しに続けて prefresh を呼び出すことと
機能的に同等です。
1 つの文字だけが出力されるという知識は考慮され、そして、
非制御文字に対しては、等価な関数よりもこれらのルーチン
(訳注: pechochar, pecho_wchar)
を使うことで相当な性能の向上がみられることがあります。
pechochar の場合には、画面上のパッドの最後の位置が
prefresh の引数として再利用されます。
The pecho_wchar function is the analogous wide-character
form of pechochar. It outputs one character to a pad and
immediately refreshes the pad. It does this by a call to
wadd_wch followed by a call to prefresh.
pecho_wchar 関数は、 pechochar に類似したワイド文字版です。
1 文字をパッドに出力し、そのパッドをすぐに更新します。
wadd_wch 呼び出しに続けて prefresh を呼び出すことで
これを行います。
Routines that return an integer return ERR upon failure
and OK (SVr4 only specifies "an integer value other than
ERR") upon successful completion.
整数を返すルーチンは、失敗したときに ERR を、
正常終了のときに OK ( SVr4 は「 ERR 以外の整数値」としか
指定していません) を返します。
Routines that return pointers return NULL on error, and
set errno to ENOMEM.
ポインタを返すルーチンは、エラーのときに NULL を返し、
errno に ENOMEM をセットします。
X/Open does not define any error conditions. In this im-
plementation
X/Open はエラーの条件を何も定義していません。この実装では
prefresh and pnoutrefresh
prefresh と pnoutrefresh
return an error if the window pointer is null, or
if the window is not really a pad or if the area
to refresh extends off-screen or if the minimum
coordinates are greater than the maximum.
ウインドウ・ポインタがヌルのとき、
またはウインドウが実際にはパッドでないとき、
または更新する領域が画面の外に広がっているとき、
または座標の最小値が最大値よりも大きいときに
エラーを返します。
pechochar
returns an error if the window is not really a
pad, and the associated call to wechochar returns
an error.
ウインドウが実際にはパッドでないとき、そして
付随する wechochar 呼び出しがエラーを返したときに
エラーを返します。
pecho_wchar
returns an error if the window is not really a
pad, and the associated call to wecho_wchar re-
turns an error.
ウインドウが実際にはパッドでないとき、そして
付随する wecho_wchar 呼び出しがエラーを返したときに
エラーを返します。
Note that pechochar may be a macro.
pechochar はマクロであるかもしれないことに注意してください。
The XSI Curses standard, Issue 4 describes these func-
tions.
これらの関数は XSI Curses standard, Issue 4 に
記載されています。
curses(3x), curs_refresh(3x), curs_touch(3x),
curs_addch(3x).
curs_pad(3x)