⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fns.doc

📁 早期freebsd实现
💻 DOC
📖 第 1 页 / 共 2 页
字号:
It is possible to use this optimizationwithout the benefit of the screen routines.With the screen routines, this should not be called by the user..Fn moveand.Fn refreshshould be used to move the cursor position,so that the routines know what's going on..Ds.Fn mvprintw "int y" "int x" "const char *fmt" "...".DeEquivalent to:.(lmove(y, x);printw(fmt, ...);.)l.Ds .Fn mvscanw "int y" "int x" "const char *fmt" "...".DeEquivalent to:.(lmove(y, x);scanw(fmt, ...);.)l.Ds.Fn mvwin "WINDOW *win" "int y" "int 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.Fn mvwprintw "WINDOW *win" "int y" "int x" "const char *fmt" "...".DeEquivalent to:.(lwmove(win, y, x);printw(fmt, ...);.)l.Ds.Fn mvwscanw "WINDOW *win" "int y" "int x" "const char *fmt" "...".DeEquivalent to:.(lwmove(win, y, x);scanw(fmt, ...);.)l.Ds.Ft "WINDOW *".Fn newwin "int lines" "int cols" "int begin_y" "int 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.Fn nl "" \(dg.DeSet the terminal to 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.Fn nocbreak "" \(dg.DeUnset the terminal from cbreak mode..Ds.Fn nocrmode "" \(dg.DeIdentical to.Fn nocbreak .The misnamed macro.Fn nocrmodeis retained for backwards compatibilitywith ealier versions of the library..Ds.Fn noecho "" \(dg.DeTurn echoing of characters off..Ds.Fn nonl "" \(dg.DeUnset the terminal to from nl mode.  See .Fn nl ..Ds.Fn noraw "" \(dg.DeUnset the terminal from raw mode.  See .Fn raw ..Ds.Fn overlay "WINDOW *win1" "WINDOW *win2".DeOverlay.Vn win1on.Vn win2 .The contents of.Vn win1 ,insofar as they fit,are placed on.Vn win2at their starting \*y.This is done non-destructively,i.e., blanks on.Vn win1leave the contents of the space on.Vn win2untouched.  Note that all non-blank characters are overwritten destructively in the overlay..Ds.Fn overwrite "WINDOW *win1" "WINDOW *win2".DeOverwrite.Vn win1on.Vn win2 .The contents of.Vn win1 ,insofar as they fit,are placed on.Vn win2at their starting \*y.This is done destructively,.i i.e. ,blanks on.Vn win1become blank on.Vn win2 ..Ds.Fn printw "char *fmt" "...".DePerforms a.Fn printfon the window starting at the current \*y.It uses.Fn addstrto add the string on the window.It is often advisable to use the field width options of.Fn printfto avoid leaving things on the window from earlier calls.\*(Es.Ds.Fn raw "" \(dg.DeSet the terminal to raw mode.On version 7.Un \**.(f\**.Unis a trademark of Unix System Laboratories..)fthis also turns off newline mapping(see.Fn nl )..Ds.Fn refresh "" \(dg.DeSynchronize the terminal screen with the desired window.If the window is not a screen,only that part covered by it is updated.\*(EsIn this case, it will update whatever it canwithout causing the scroll..spAs a special case,if.Fn wrefreshis called with the window.Vn curscrthe screen is clearedand repainted as it is currently.This is very useful for allowing the redrawing of the screenwhen the user has garbage dumped on his terminal..Ds.Fn resetty "" \(dg.De.Fn resettyrestores them to what.Fn savettystored.These functions are performed automatically by.Fn initscrand.Fn endwin .  This function should not be used by the user..Ds.Fn savetty "" \(dg.De.Fn savettysaves the current tty characteristic flags. See.Fn resetty .This function should not be used by the user..Ds.Fn scanw "char *fmt" "...".DePerform a.Fn scanfthrough the window using.Vn fmt .It does this using consecutive calls to .Fn getch(or.Fn wgetch ).\*(Es.Ds.Fn scroll "WINDOW *win".DeScroll the window upward one line.This is normally not used by the user..Ds.Fn scrollok "WINDOW *win" "int boolf" \(dg.DeSet the scroll flag for the given window.If.Vn boolfis 0, scrolling is not allowed.This is its default setting..Ds.Fn standend "" \(dg.DeEnd standout mode initiated by.Fn standout ..Ds.Fn standout "" \(dg.DeCauses any characters added to the windowto be put in standout mode on the terminal(if it has that capability)..Ds.Ft "WINDOW *".Fn subwin "WINDOW *win" "int lines" "int cols" "int begin_y" "int 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.Fn touchline "WINDOW *win" "int y" "int startx" "int 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.Fn touchoverlap "WINDOW *win1" "WINDOW *win2".DeTouch the window.Vn win2in the area which overlaps with.Vn win1 .If they do not overlap,no changes are made..Ds.Fn touchwin "WINDOW *win".DeMake it appear that the every location on the windowhas been changed.This is usually only needed for refreshes with overlapping windows..Ds.Fn tstp.DeThis functionwill save the current tty stateand then put the process to sleep.When the process gets restarted,it restores the saved tty stateand then calls.Fn wrefresh "curscr"to redraw the screen..Fn Initscrsets the signalSIGTSTPto trap to this routine..Ds.Fn unctrl "char *ch" \(dg.DeReturns a string which is an ASCII representation of.Vn ch .  Characters are 8 bits long..Ds.Fn unctrllen "char *ch" \(dg.DeReturns the length of the ASCII representation of .Vn ch ..Ds.Fn vwprintw "WINDOW *win" "const char *fmt" "va_list ap".DeIdentical to .Fn printw except that it takes both a window specification and a pointer to a variablelength argument list..Ds.Fn vwscanw "WINDOW *win" "const char *fmt" "va_list ap".DeIdentical to .Fn scanwexcept that it takes both a window specification and a pointer to a variablelength argument list..Ds.Fn waddbytes "WINDOW *win" "char *str" "int len".DeThis function is the low level character output function.  .Vn Lencharacters of the string.Vn strare output to the current \*y position of the window specified by.Vn win..sp 2.pp\fIThe following functions differ from the standard functions only in their specification of a window, rather than the use of the default.Vn stdscr.\fP.Ds.Fn waddch "WINDOW *win" "char ch" .Fn waddstr "WINDOW *win" "char *str" .Fn wclear "WINDOW *win"  .Fn wclrtobot "WINDOW *win"  .Fn wclrtoeol "WINDOW *win"  .Fn wdelch "WINDOW *win"  .Fn wdeleteln "WINDOW *win" .Fn werase "WINDOW *win" .Fn wgetch "WINDOW *win" .Fn wgetstr "WINDOW *win" "char *str" .Fn winch "WINDOW *win" \(dg.Fn winsch "WINDOW *win" "char c" .Fn winsertln "WINDOW *win" .Fn wmove "WINDOW *win" "int y" int x" .Fn wprintw "WINDOW *win" "char *fmt" "..." .Fn wrefresh "WINDOW *win" .Fn wscanw "WINDOW *win" "char *fmt" "..." .Fn wstandend "WINDOW *win" .Fn wstandout "WINDOW *win".Dg

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -