📄 doc.iii
字号:
.\" Copyright (c) 1980, 1993.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)doc.III 8.1 (Berkeley) 6/4/93.\".Ds.Fd baudrate "" \*m.DeReturns the output baud rate of the terminal.This is a system dependent constant(defined in.b <sys/tty.h>on BSD systems,which is included by.b <curses.h> )..Ds.Fd delwin winWINDOW *win;.DeDeletes the window from existence.All resources are freed for future use by.b calloc (3).If a window has a.Fn subwinallocated window inside of it,deleting the outer windowthe subwindow is not affected,even though this does invalidate it.Therefore,subwindows should be deleted before theirouter windows are..Ds.Fd endwin.DeFinish up window routines before exit.This restores the terminal to the state it was before.Fn initscr(or.Fn gettmodeand.Fn setterm )was called.It should always be called before exiting.It does not exit.This is especially useful for resetting tty statswhen trapping rubouts via.b signal (2)..Ds.Fd erasechar "" \*m.DeReturns the erase characterfor the terminal,.i i.e. ,the character used by the user to erase a single character from the input..Ds.Fd getcap str "" "char *"char *str;.DeReturn a pointer to the.b termcapcapability described by.Vn str(see.b termcap (5)for details)..Ds.Fd getyx win\*,y\*,x \*mWINDOW *win;int y\*,x;.DePuts the current \*y of.Vn winin the variables.Vn yand.Vn x .Since it is a macro,not a function,you do not pass the addressof.Vn yand.Vn x ..Ds.Fd inch "" \*m.Fd winch win \*mWINDOW *win;.DeReturns the character at the current \*(yon the given window.This does not make any changes to the window..Ds.Fd initscr.DeInitialize the screen routines.This must be called before any of the screen routines are used.It initializes the terminal-type data and such,and without it none of the routines can operate.If standard input is not a tty,it sets the specifications to the terminalwhose name is pointed to by.Vn Def\*_term(initialy "dumb").If the boolean.Vn My\*_termis true,.Vn Def\*_termis always used.If the system supports the.b TIOCGWINSZ.Fn ioctl "" "" 2call,it is used to get the number of lines and columns for the terminal,otherwise it is taken from the.b termcapdescription..Ds.Fd killchar "" \*m.DeReturns the line kill characterfor the terminal,.i i.e. ,the character used by the user to erase an entire line from the input..Ds.Fd leaveok win\*,boolf \*mWINDOW *win;bool boolf;.DeSets the boolean flag for leaving the cursor after the last change.If.Vn boolfis TRUE,the cursor will be left after the last update on the terminal,and the current \*y for.Vn winwill be changed accordingly.If it is FALSE,it will be moved to the current \*y.This flag(initialy FALSE)retains its value until changed by the user..Ds.Fd longname termbuf\*,namechar *termbuf\*,*name;.Fd fullname termbuf\*,namechar *termbuf\*,*name;.De.Fn longnamefills in.Vn namewith the long name of the terminal described by the.b termcapentry in.Vn termbuf .It is generally of little use,but is nice for telling the user in a readable format what terminalwe think he has.This is available in the global variable.Vn ttytype ..Vn termbufis usually set via the termlib routine.Fn tgetent ..Fn fullnameis the same as.Fn longname ,except that it gives the fullest name given in the entry,which can be quite verbose..Ds.Fd mvwin win\*,y\*,xWINDOW *win;int y, x;.DeMove the home position of the window.Vn winfrom its current starting coordinatesto.Vn y\*,x ). (If that would put part or all of the windowoff the edge of the terminal screen,.Fn mvwinreturns ERR and does not change anything.For subwindows,.Fn mvwinalso returns ERR if you attempt to move it off its main window.If you move a main window,all subwindows are moved along with it..Ds.Fd newwin lines\*,cols\*,begin\*_y\*,begin\*_x "" "WINDOW *"int lines\*,cols\*,begin\*_y\*,begin\*_x;.DeCreate a new window with.Vn lineslines and.Vn colscolumns starting at position.Vn begin\*_y\*,begin\*_x ). (If either.Vn linesor.Vn colsis 0 (zero),that dimension will be set to.Vn "LINES \- begin\*_y" ) (or.Vn "COLS \- begin\*_x" ) (respectively.Thus, to get a new window of dimensions.Vn LINES\(mu.Vn COLS ,use.Fn newwin . "" 0\*,0\*,0\*,0.Ds.Fd nl "" \*m.Fd nonl "" \*m.DeSet or unset the terminal to/from nl mode,.i i.e. ,start/stop the system from mapping.b <RETURN>to.b <LINE-FEED> .If the mapping is not done,.Fn refreshcan do more optimization,so it is recommended, but not required, to turn it off..Ds.Fd scrollok win\*,boolf \*mWINDOW *win;bool boolf;.DeSet the scroll flag for the given window.If.Vn boolfis FALSE, scrolling is not allowed.This is its default setting..Ds.Fd touchline win\*,y\*,startx\*,endxWINDOW *win;int y\*,startx\*,endx;.DeThis function performs a function similar to.Fn touchwinon a single line.It marks the first change for the given lineto be.Vn startx ,if it is before the current first change mark,andthe last change mark is set to be.Vn endxif it is currently less than.Vn endx ..Ds.Fd touchoverlap win1\*,win2WINDOW *win1, *win2;.DeTouch the window.Vn win2in the area which overlaps with.Vn win1 .If they do not overlap,no changes are made..Ds.Fd touchwin winWINDOW *win;.DeMake it appear that the every location on the windowhas been changed.This is usually only needed for refreshes with overlapping windows..Ds.Fd subwin win\*,lines\*,cols\*,begin\*_y\*,begin\*_x "" "WINDOW *"WINDOW *win;int lines\*,cols\*,begin\*_y\*,begin\*_x;.DeCreate a new window with.Vn lineslines and.Vn colscolumns starting at position.Vn begin\*_y\*,begin\*_x ) (inside the window.i win .This means that any change made to either windowin the area coveredby the subwindow will be made on both windows..Vn begin\*_y\*,begin\*_xare specified relative to the overall screen,not the relative (0\*,0) of.Vn win .If either.Vn linesor.Vn colsis 0 (zero),that dimension will be set to.Vn "LINES \- begin\*_y" ) (or.Vn "COLS \- begin\*_x" ) (respectively..Ds.Fd unctrl ch \*mchar ch;.DeThis is actually a debug function for the library,but it is of general usefulness.It returns a string which is a representation of.Vn ch .Control characters become their upper-case equivalents preceded by a "^".Other letters stay just as they are.To use.Fn unctrl ,you may have to have.b #include\ <unctrl.h>in your file.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -