?? curs_kernel.3x
字號:
.\"***************************************************************************.\" Copyright (c) 1998 Free Software Foundation, Inc. *.\" *.\" Permission is hereby granted, free of charge, to any person obtaining a *.\" copy of this software and associated documentation files (the *.\" "Software"), to deal in the Software without restriction, including *.\" without limitation the rights to use, copy, modify, merge, publish, *.\" distribute, distribute with modifications, sublicense, and/or sell *.\" copies of the Software, and to permit persons to whom the Software is *.\" furnished to do so, subject to the following conditions: *.\" *.\" The above copyright notice and this permission notice shall be included *.\" in all copies or substantial portions of the Software. *.\" *.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *.\" *.\" Except as contained in this notice, the name(s) of the above copyright *.\" holders shall not be used in advertising or otherwise to promote the *.\" sale, use or other dealings in this Software without prior written *.\" authorization. *.\"***************************************************************************.\".\" $Id: curs_kernel.3x,v 1.13 2001/12/08 18:01:25 tom Exp $.TH curs_kernel 3X "".SH NAME\fBdef_prog_mode\fR, \fBdef_shell_mode\fR,\fBreset_prog_mode\fR, \fBreset_shell_mode\fR, \fBresetty\fR,\fBsavetty\fR, \fBgetsyx\fR, \fBsetsyx\fR, \fBripoffline\fR,\fBcurs_set\fR, \fBnapms\fR - low-level \fBcurses\fR routines.SH SYNOPSIS\fB#include <curses.h>\fR\fBint def_prog_mode(void);\fR.br\fBint def_shell_mode(void);\fR.br\fBint reset_prog_mode(void);\fR.br\fBint reset_shell_mode(void);\fR.br\fBint resetty(void);\fR.br\fBint savetty(void);\fR.br\fBvoid getsyx(int y, int x);\fR.br\fBvoid setsyx(int y, int x);\fR.br\fBint ripoffline(int line, int (*init)(WINDOW *, int));\fR.br\fBint curs_set(int visibility);\fR.br\fBint napms(int ms);\fR.br.SH DESCRIPTIONThe following routines give low-level access to various \fBcurses\fRcapabilities. Theses routines typically are used inside libraryroutines.The \fBdef_prog_mode\fR and \fBdef_shell_mode\fR routines save thecurrent terminal modes as the "program" (in \fBcurses\fR) or "shell"(not in \fBcurses\fR) state for use by the \fBreset_prog_mode\fR and\fBreset_shell_mode\fR routines. This is done automatically by\fBinitscr\fR. There is one such save area for each screen contextallocated by \fBnewterm()\fR.The \fBreset_prog_mode\fR and \fBreset_shell_mode\fR routines restorethe terminal to "program" (in \fBcurses\fR) or "shell" (out of\fBcurses\fR) state. These are done automatically by \fBendwin\fRand, after an \fBendwin\fR, by \fBdoupdate\fR, so they normally arenot called.The \fBresetty\fR and \fBsavetty\fR routines save and restore thestate of the terminal modes. \fBsavetty\fR saves the current state ina buffer and \fBresetty\fR restores the state to what it was at thelast call to \fBsavetty\fR.The \fBgetsyx\fR routine returns the current coordinates of the virtual screencursor in \fIy\fR and \fIx\fR. If \fBleaveok\fR is currently \fBTRUE\fR, then\fB-1\fR,\fB-1\fR is returned. If lines have been removed from the top of thescreen, using \fBripoffline\fR, \fIy\fR and \fIx\fR include these lines;therefore, \fIy\fR and \fIx\fR should be used only as arguments for\fBsetsyx\fR.The \fBsetsyx\fR routine sets the virtual screen cursor to\fIy\fR, \fIx\fR. If \fIy\fR and \fIx\fR are both \fB-1\fR, then\fBleaveok\fR is set. The two routines \fBgetsyx\fR and \fBsetsyx\fRare designed to be used by a library routine, which manipulates\fBcurses\fR windows but does not want to change the current positionof the program's cursor. The library routine would call \fBgetsyx\fRat the beginning, do its manipulation of its own windows, do a\fBwnoutrefresh\fR on its windows, call \fBsetsyx\fR, and then call\fBdoupdate\fR.The \fBripoffline\fR routine provides access to the same facility that\fBslk_init\fR [see \fBcurs_slk\fR(3X)] uses to reduce the size of thescreen. \fBripoffline\fR must be called before \fBinitscr\fR or\fBnewterm\fR is called. If \fIline\fR is positive, a line is removedfrom the top of \fBstdscr\fR; if \fIline\fR is negative, a line isremoved from the bottom. When this is done inside \fBinitscr\fR, theroutine \fBinit\fR (supplied by the user) is called with twoarguments: a window pointer to the one-line window that has beenallocated and an integer with the number of columns in the window.Inside this initialization routine, the integer variables \fBLINES\fRand \fBCOLS\fR (defined in \fB<curses.h>\fR) are not guaranteed to beaccurate and \fBwrefresh\fR or \fBdoupdate\fR must not be called. Itis allowable to call \fBwnoutrefresh\fR during the initializationroutine.\fBripoffline\fR can be called up to five times before calling \fBinitscr\fR or\fBnewterm\fR.The \fBcurs_set\fR routine sets the cursor state is set to invisible,normal, or very visible for \fBvisibility\fR equal to \fB0\fR,\fB1\fR, or \fB2\fR respectively. If the terminal supports the\fIvisibility\fR requested, the previous \fIcursor\fR state isreturned; otherwise, \fBERR\fR is returned.The \fBnapms\fR routine is used to sleep for \fIms\fR milliseconds..SH RETURN VALUEExcept for \fBcurs_set\fR, these routines always return \fBOK\fR.\fBcurs_set\fR returns the previous cursor state, or \fBERR\fR if therequested \fIvisibility\fR is not supported..SH NOTESNote that \fBgetsyx\fR is a macro, so \fB&\fR is not necessary beforethe variables \fIy\fR and \fIx\fR.Older SVr4 man pages warn that the return value of \fBcurs_set\fR "is currentlyincorrect". This implementation gets it right, but it may be unwise to counton the correctness of the return value anywhere else.Both ncurses and SVr4 will call \fBcurs_set\fR in \fBendwin\fRif \fBcurs_set\fRhas been called to make the cursor other than normal, i.e., eitherinvisible or very visible.There is no way for ncurses to determine the initial cursor state torestore that..SH PORTABILITYThe functions \fBsetsyx\fR and \fBgetsyx\fR are not described in the XSICurses standard, Issue 4. All other functions are as described in XSI Curses.The SVr4 documentation describes \fBsetsyx\fR and \fBgetsyx\fR as having returntype int. This is misleading, as they are macros with no documented semanticsfor the return value..SH SEE ALSO\fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_outopts\fR(3X), \fBcurs_refresh\fR(3X),\fBcurs_scr_dump\fR(3X), \fBcurs_slk\fR(3X).\"#.\"# The following sets edit modes for GNU EMACS.\"# Local Variables:.\"# mode:nroff.\"# fill-column:79.\"# End:
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -