1
0
Files
irix-657m-src/eoe/man/man3x/curs_kernel.3x
2022-09-29 17:59:04 +03:00

184 lines
4.8 KiB
Plaintext

'\"macro stdmacro
.if n .pH g3x.curs_kernel @(#)curs_kernel 40.5 of 4/10/91
.\" Copyright 1991 UNIX System Laboratories, Inc.
.\" Copyright 1989, 1990 AT&T
.\" ident "@(#)svid_ti:ti_lib/curs_kernel 1.4"
.nr X
.if \nX=0 .ds x} curs_kernel 3X "" "\&"
.if \nX=1 .ds x} curs_kernel 3X ""
.if \nX=2 .ds x} curs_kernel 3X "" "\&"
.if \nX=3 .ds x} curs_kernel "" "" "\&"
.TH \*(x}
.SH NAME
.na
\f4curs_kernel\f2: \f4 def_prog_mode\f1, \f4def_shell_mode\f1, \f4reset_prog_mode\f1, \f4reset_shell_mode\f1, \f4resetty\f1, \f4savetty\f1, \f4getsyx\f1, \f4setsyx\f1, \f4ripoffline\f1, \f4curs_set\f1, \f4napms\f1 \- low-level \f4curses\fP routines
.ad
.SH SYNOPSIS
.nf
.ft 4
#include <curses.h>
.sp
int def_prog_mode(void);
.sp 0.5
int def_shell_mode(void);
.sp 0.5
int reset_prog_mode(void);
.sp 0.5
int reset_shell_mode(void);
.sp 0.5
int resetty(void);
.sp 0.5
int savetty(void);
.sp 0.5
int getsyx(int y, int x);
.sp 0.5
int setsyx(int y, int x);
.sp 0.5
int ripoffline(int line, int (*init)(WINDOW *, int));
.sp 0.5
int curs_set(int visibility);
.sp 0.5
int napms(int ms);
.ft 1
.fi
.SH DESCRIPTION
The following routines give low-level access to various \f4curses\fP
functionality.
Theses routines typically are used inside library routines.
.PP
The \f4def_prog_mode\f1 and \f4def_shell_mode\f1 routines
save the current terminal modes as the "program"
(in \f4curses\fP) or "shell" (not
in \f4curses\fP) state for use by the
\f4reset_prog_mode\f1
and
\f4reset_shell_mode\f1
routines.
This is done automatically by
\f4initscr\f1.
.P
The \f4reset_prog_mode\f1 and
\f4reset_shell_mode\f1 routines
restore the terminal to "program" (in \f4curses\fP) or "shell"
(out of \f4curses\fP) state.
These are done automatically by \f4endwin\f1 and,
after an \f4endwin\f1,
by \f4doupdate\f1,
so they normally are not called.
.P
The \f4resetty\f1 and \f4savetty\f1
routines save and restore the state of the terminal modes.
\f4savetty\f1
saves the current state in a buffer and
\f4resetty\f1
restores the state to what it was at the last call to
\f4savetty\f1.
.P
With the \f4getsyx\f1 routine,
the current coordinates of the virtual screen cursor are returned in
\f2y\f1 and \f2x.\f1
If \f4leaveok\f1
is currently \f4TRUE\f1\s0,
then
\f4\-1\f1,\f4\-1\f1 is returned.
If lines have been removed from the top of the screen,
using \f4\%ripoffline\f1,
\f2y\f1 and \f2x\f1 include these lines;
therefore, \f2y\f1 and \f2x\f1 should be used only as arguments for
\f4setsyx\f1.
.P
With the \f4setsyx\f1 routine,
the virtual screen cursor is set to
\f2y\f1, \f2x\f1.\f1
If \f2y\f1 and \f2x\f1 are both \f4\-1\f1,
then \f4leaveok\f1 is set.
The two routines \f4getsyx\f1 and \f4\%setsyx\f1
are designed to be used by a library routine,
which manipulates \f4curses\fP windows but does not want
to change the current position of the program's cursor.
The library routine would call \f4getsyx\f1
at the beginning,
do its manipulation of its own windows,
do a \f4wnoutrefresh\f1 on its windows,
call \f4setsyx\f1,
and then call \f4doupdate\f1.
.P
The \f4ripoffline\f1
routine provides access to the same facility that
\f4slk_init\f1
[see curs_slk(3X)]
uses to reduce the size of the screen.
\f4ripoffline\f1 must be called before
\f4initscr\f1 or \f4newterm\f1 is called.
If \f2line\f1 is positive,
a line is removed from the top of \f4stdscr\f1;
if \f2line\f1 is negative,
a line is removed from the bottom.
When this is done inside
\f4initscr\f1,
the routine \f4init\f1 (supplied by the user)
is called with two arguments:
a window pointer to the one-line window that has been allocated and
an integer with the number of columns in the window.
Inside this initialization routine,
the integer variables
\f4LINES\s0\f1
and
\f4COLS\s0\f1
(defined in \f4<curses.h>\f1)
are not guaranteed to be
accurate and
\f4wrefresh\f1
or
\f4doupdate\f1
must not be called.
It is allowable to call
\f4wnoutrefresh\f1
during the initialization routine.
.P
\f4ripoffline\f1
can be called up to five times before calling
\f4initscr\f1
or
\f4newterm\f1.
.P
With the \f4curs_set\f1 routine,
the cursor state is set to invisible, normal, or very visible for
\f4visibility\f1
equal to
\f40\f1,
\f41\f1,
or
\f42\f1
respectively.
If the terminal supports the
.IR visibility
requested, the previous
.IR cursor
state is returned;
otherwise,
\f4ERR\s0\f1
is returned.
.P
The \f4napms\f1 routine is used to
sleep for \f2ms\f1 milliseconds.
.SH RETURN VALUE
Except for \f4curs_set\fP, these routines always return \f4OK\f1.
\f4curs_set\fP returns the previous cursor state, or \f4ERR\fP if
the requested \f2visibility\fP is not supported.
.SH NOTES
The header file \f4<curses.h>\f1 automatically includes the header files
\f4<stdio.h>\f1 and \f4<unctrl.h>\f1.
.PP
Note that \f4getsyx\f1 is a macro,
so \f4&\f1 is not necessary before the variables \f2y\f1 and \f2x\f1.
.SH SEE ALSO
.na
\f4curses\fP(3X),
\f4curs_initscr\fP(3X),
\f4curs_outopts\fP(3X),
\f4curs_refresh\fP(3X),
\f4curs_scr_dump\fP(3X),
\f4curs_slk\fP(3X)
.ad