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

📄 paper.ps

📁 早期freebsd实现
💻 PS
📖 第 1 页 / 共 5 页
字号:
(ince the screen package needs to kno)327.01 597.6 R 2.55(ww)-.25 G(hat)491.78597.6 Q .255(is on the terminal at all times, if characters are to be echoed, \the tty must be in ra)72 609.6 R 2.755(wo)-.15 G 2.755(rc)414.135 609.6 S .255(break mode.)424.66 609.6 R .255(If it is)5.255 F(not,)72 621.6 Q F3(getch)2.5E F1(\(\) sets it to be cbreak, and then reads in the character)A(.)-.55 E F0-4.998(33)72 645.6 S -2.498(..)4.998 G -4.998(44)2.498 G 7.496 -2.498(.. T)4.998 H -.92(Te)92.01 645.6 S(er)97.762 645.6 Q(rm)102.204 645.6 Q(mi)106.646645.6 Q(in)114.978 645.6 Q(na)117.76 645.6 Q(at)123.322 645.6 Q(ti)128.324645.6 Q(io)131.656 645.6 Q(on)134.438 645.6 Q(n)139.44 645.6 Q F1 .044(In order to perform certain optimizations, and, on some terminals, to w)97661.8 R .044(ork at all, some things must be)-.1 F .058(done before the screen routines start up.)72 673.8 R .059(These functions are performed in)5.059 F F3(getttmode)2.559 E F1 .059(\(\) and)B F3(setterm)2.559 E F1(\(\),)A .233(which are called by)72 685.8 RF3(initscr)2.733 E F1 2.733(\(\). In)B .233(order to clean up after the routines, the routine)2.733 F F3(endwin)2.733 E F1.233(\(\) is pro)B(vided.)-.15 E .406(It restores tty modes to what the)72697.8 R 2.906(yw)-.15 G .406(ere when)217.732 697.8 R F3(initscr)2.906 E F1.407(\(\) w)B .407(as f)-.1 F .407(irst called.)-.2 F .407(The terminal state module uses)5.407 F .793(the v)72 709.8 R(ariable)-.25 E F2(cur)3.293 E(ses_termios)-.1 E F1 .793(to sa)3.293 F 1.093 -.15(ve t)-.2 H .793(he original terminal state which is then restored upon a call to).15 F F3(end-)3.292 E(win)72 721.8 Q F1 3.451(\(\). Thus,)B(an)3.451 E .951(ytime after the call to initscr)-.15 F(,)-.4 E F3(endwin)3.451 E F1 .952(\(\) should be called before e)B 3.452(xiting. Note)-.15 F(ho)3.452 E(we)-.25E -.15(ve)-.25 G -.4(r,).15 G EP%%Page: 6 5%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Bold@0 SF -6.108(PP)72 60 S -5.558(SS)6.108 G -4.998(11)5.558 G-3.328(::)4.998 G -4.998(11)3.328 G -4.998(99)4.998 G -3.328(--)4.998 G 334.474-4.998(66 S)3.328 H(Sc)-.56 E(cr)442.888 60 Q -.18(re)447.33 60 S(ee)451.592 60Q(en)456.034 60 Q 2.5(nP)460.476 60 S -.1(Pa)468.538 60 S(ac)474.55 60 Q(ck)479.552 60 Q(ka)483.994 60 Q(ag)489.556 60 Q(ge)494.558 60 Q(e)499.56 60 Q/F110/Times-Roman@0 SF(that)72 96 Q/F2 10/Courier-Bold@0 SF(endwin)3.338 E F1 .838(\(\) should al)B -.1(wa)-.1 G .838(ys be called).1 F F0 -5.558(bb)3.338 G-4.438(ee)5.558 G 3.906 -3.328(ff o)4.438 H(or)-1.67 E -.18(re)255.338 96 S(e)259.6 96 Q F1 .838(the f)3.338 F .838(inal calls to)-.2 F F2(delwin)3.337 E F1.837(\(\), which free the storage of the)B(windo)72 108 Q(ws.)-.25 E F0 -4.998(44)72 132 S 7.496 -2.498(.. C)4.998 H(Cu)84.506 132 Q(ur)91.728 132 Q(rs)97.29132 Q(so)101.732 132 Q(or)105.624 132 Q 2.5(rM)110.626 132 S(Mo)117.568 132 Q-.1(ov)127.01 132 S -.1(ve)131.912 132 S(em)136.814 132 Q(me)141.256 132 Q(en)149.588 132 Q(nt)154.03 132 Q 2.5(tO)159.592 132 S(Op)165.424 132 Q(pt)173.206132 Q(ti)178.768 132 Q(im)182.1 132 Q(mi)184.882 132 Q(iz)193.214 132 Q(za)195.996 132 Q(at)200.438 132 Q(ti)205.44 132 Q(io)208.772 132 Q(on)211.554 132Q(ns)216.556 132 Q(s)222.118 132 Q F1 .168(One of the most dif)97 148.2 R -.2(fi)-.25 G .168(cult things to do properly is motion optimization.).2 F .168(After using)5.168 F F2(gettmode)2.668 E F1 .168(\(\) and)B F2(setterm)72 160.2Q F1 .367(\(\) to get the terminal descriptions, the function)B F2(mvcur)2.866E F1 .366(\(\) deals with this task.)B .366(It usage is simple:)5.366 F(simply tell it where you are no)72 172.2 Q 2.5(wa)-.25 G(nd where you w)208.12172.2 Q(ant to go.)-.1 E -.15(Fo)5 G 2.5(re).15 G(xample)335.2 172.2 Q(mvcur\(0, 0, LINES/2, COLS/2\);)112 188.4 Q -.1(wo)72 208.8 S .04(uld mo).1 F.34 -.15(ve t)-.15 H .04(he cursor from the home position \(0,).15 F .04(0\) to the middle of the screen.)2.5 F .04(If you wish to force abso-)5.04 F.684(lute addressing, you can use the function)72 220.8 R F2(tgoto)3.184 E F1.684(\(\) from the)B F0 -3.328(tt)3.184 G -4.438(ee)3.328 G -4.438(rr)4.438 G-8.328(mm)4.438 G -2.778(ll)8.328 G -2.778(ii)2.778 G -5.558(bb)2.778 G F1 .684(\(7\) routines, or you can tell)5.558 F F2(mvcur)3.184 E F1(\(\))A 1.602(that you are impossibly f)72 232.8 R 1.602(ar a)-.1 F -.1(wa)-.15 G 2.902 -.65(y, F).1 H 1.602(or e).5 F 1.602(xample, to absolutely address the lo)-.15 F1.603(wer left hand corner of the)-.25 F(screen from an)72 244.8 Q(ywhere just claim that you are in the upper right hand corner:)-.15 E(mvcur\(0, COLS\2551, LINES\2551, 0\);)112 261 Q F0 -4.998(55)72 289.2 S 7.496-2.498(.. C)4.998 H(Ch)84.506 289.2 Q(ha)91.728 289.2 Q(ar)97.29 289.2 Q(ra)102.292 289.2 Q(ac)106.734 289.2 Q(ct)111.736 289.2 Q(te)116.178 289.2 Q(er)119.51 289.2 Q 2.5(rO)123.952 289.2 S(Ou)130.894 289.2 Q(ut)138.676 289.2 Q(tp)144.238 289.2 Q(pu)147.57 289.2 Q(ut)153.132 289.2 Q 2.5(ta)158.694 289.2 S(an)164.526 289.2 Q(nd)169.528 289.2 Q 2.5(dS)175.09 289.2 S(Sc)183.152 289.2 Q(cr)188.714 289.2 Q -.18(ro)193.156 289.2 S(ol)197.418 289.2 Q(ll)202.42 289.2 Q(li)205.202 289.2 Q(in)207.984 289.2 Q(ng)210.766 289.2 Q(g)216.328 289.2 Q F1.01(The character output polic)97 305.4 R 2.51(yd)-.15 G .01(eals with the follo)214.64 305.4 R .01(wing problems.)-.25 F .01(First, where is the location of the cur)5.01 F(-)-.2 E(sor after a character is printed, and secondly)72 317.4 Q 2.5(,w)-.65 G(hen does the screen scroll if scrolling is enabled.)260.18 317.4 Q .007(In the normal case the characters are output as e)97 333.6 R .007(xpected, with the cursor occup)-.15 F .007(ying the position of the)-.1 F(ne)72 345.6 Q 1.181(xt character to be output.)-.15 F(Ho)6.181 E(we)-.25 E -.15(ve)-.25 G 1.981 -.4(r, w).15 H 1.181(hen the cursor is on the last column of the line, the cursor will).4 F .129(r\emain on that position after the last character on the line is output and will\ only assume the position on the)72 357.6 R(ne)72 369.6 Q(xt line when the ne)-.15 E(xt character \(the f)-.15 E(irst on the ne)-.2 E(xt line\) is output.)-.15 E(Lik)97 385.8 Q -.25(ew)-.1 G .226(ise, if scrolling is enabled, a scroll will be in).25 F -.2(vo)-.4 G -.1(ke).2G 2.726(do).1 G .226(nly when the f)332.632 385.8 R .226(irst character on he f)-.2 F .226(irst line)-.2 F .697(past the bottom line of the windo)72 397.8 R 3.197(wi)-.25 G 3.197(so)221.349397.8 S 3.197(utput. If)233.436 397.8 R .697(scrolling is not enabled the chracters will to be output to)3.197 F(the bottom right corner of the windo)72 409.8 Q 2.5(ww)-.25 G(hich is the cursor location.)234.23 409.8 Q .368(This polic)97 426 R 2.868(ya)-.15 G(llo)149.806 426 Q .368(ws consistent beha)-.25 F .368(vior of the cursor at the boundary conditions.)-.2 F .367(Furthermore, it pre-)5.368 F -.15(ve)72 438 S .494(nts a scroll from happenin\g before it is actually needed \(the old package used to scroll when the botto\m).15 F(right position w)72 450 Q(as output a character\).)-.1 E(As a precendent, it models the)5 E/F3 10/Times-Italic@0 SF(xterm)2.5 E F1(character output con)2.5 E -.15(ve)-.4 G(ntions.).15 E F0 -4.998(66)72 474 S7.496 -2.498(.. T)4.998 H -.92(Te)84.506 474 S(er)90.258 474 Q(rm)94.7 474 Q(mi)99.142 474 Q(in)107.474 474 Q(na)110.256 474 Q(al)115.818 474 Q 2.5(lS)120.82 474 S(St)126.102 474 Q(ta)131.664 474 Q(at)134.996 474 Q(te)139.998 474Q 2.5(eH)143.33 474 S(Ha)150.272 474 Q(an)158.054 474 Q(nd)163.056 474 Q(dl)168.618 474 Q(li)174.18 474 Q(in)176.962 474 Q(ng)179.744 474 Q(g)185.306 474 QF1 1.173(The v)97 490.2 R(ariable)-.25 E F3(cur)3.673 E(ses_termios)-.1 E F11.173(contains the terminal state of the terminal.)3.673 F 1.172(Certain historical routines)6.172 F .301(return information:)72 502.2 R F2(baudrate)2.801 E F1(\(\),)A F2(erasechar)2.801 E F1(\(\),)A F2(killchar)2.801E F1 .301(\(\), and)B F2(ospeed)2.801 E F1 2.801(\(\). These)B .301(routines are obso-)2.801 F 1.059(lete and e)72 514.2 R 1.058(xist only for backw)-.15 F 1.058(ard compatibility)-.1 F 6.058(.I)-.65 G 3.558(fy)273.758 514.2 S 1.058(ou wish to use the information in the)285.646 514.2 RF3(cur)3.558 E(ses_termios)-.1 E F1(structure, you should use the)72 526.2 Q F3(tsetattr)2.5 E F1(\(3\) routines.)A F0 -4.998(77)72 550.2 S 7.496 -2.498(.. S)4.998 H(Su)84.506 550.2 Q(ub)90.068 550.2 Q(bw)95.63 550.2 Q(wi)101.192 550.2 Q(in)108.414 550.2 Q(nd)111.196 550.2 Q(do)116.758 550.2 Q -.1(ow)122.32 550.2 S(ws)127.222 550.2 Q(s)134.444 550.2 Q F1(Subwindo)97 566.4 Q 1.17(ws are windo)-.25 F 1.17(ws which do not ha)-.25 F 1.471 -.15(ve a)-.2 H 3.671(ni).15 G1.171(ndependent te)303.824 566.4 R 1.171(xt structure,)-.15 F F3(i.e)3.671 E(.)-.15 E F1 3.671(,t)C(he)434.298 566.4 Q 3.671(ya)-.15 G 1.171(re windo)456.699 566.4 R(ws)-.25 E .648(whose te)72 578.4 R .648(xt is a subset of the te)-.15 F .648(xt of a lar)-.15 F .647(ger windo)-.18 F.647(w: the)-.25 F F3(par)3.147 E(ent)-.37 E F1(windo)3.147 E 4.447 -.65(w. O)-.25 H .647(ne consequence of this is that).65 F .025(changes to either the parent or the child windo)72 590.4 R 2.525(wa)-.25 G.025(re destructi)271.655 590.4 R .325 -.15(ve t)-.25 H 2.525(ot).15 G .025(he other)341.04 590.4 R(,)-.4 E F3(i.e)2.525 E(.)-.15 E F1 2.526(,ac)C .026(hange to the subwindo)406.682 590.4 R(w)-.25 E .391(is also a change to the parent windo)72 602.4 R 2.891(wa)-.25 G .391(nd a change to the parent windo)232.068 602.4 R 2.891(wi)-.25 G 2.891(nt)374.805 602.4 S .391(he re)385.476 602.4 R .391(gion def)-.15 F .391(ined by the sub-)-.2 F(windo)72 614.4 Q 2.87(wi)-.25 G 2.87(si)109.62 614.4 S.37(mplicitly a change to the subwindo)119.16 614.4 R 2.871(wa)-.25 G 2.871(sw)275.562 614.4 S 2.871(ell. Apart)289.543 614.4 R .371(from this detail, subwindo)2.871 F .371(ws function lik)-.25 F(e)-.1 E(an)72626.4 Q 2.5(yo)-.15 G(ther windo)93.79 626.4 Q -.65(w.)-.25 G F0 -4.998(88)72650.4 S 7.496 -2.498(.. T)4.998 H(Th)84.506 650.4 Q(he)91.178 650.4 Q 2.5(eF)96.74 650.4 S(Fu)103.682 650.4 Q(un)109.794 650.4 Q(nc)115.356 650.4 Q(ct)120.918 650.4 Q(ti)125.36 650.4 Q(io)128.692 650.4 Q(on)131.474 650.4 Q(ns)136.476 650.4 Q(s)142.038 650.4 Q F1 1.409(In the follo)97 666.6 R 1.409(wing def)-.25 F 1.409(initions, \231)-.2 F/F4 8/Times-Bold@0 SF -3.998<8787>CF1 3.909<9a6d>3.998 G 1.408(eans that the \231function\232 is really a \231#def)241.477 666.6 R 1.408(ine\232 macro with ar)-.2 F(gu-)-.18 E(ments.)72 678.6 Q F2(addch)72 706.8 QF1(\()A F3 -.15(ch)C(ar c).15 E(h)-.15 E F1<293b87>A EP%%Page: 7 6%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Bold@0 SF -5.558(SS)72 60 S -4.438(cc)5.558 G 6.196 -4.438(rr ee)4.438 H -4.438(ee)4.438 G 11.116 -5.558(nn P)4.438 H -.1(Pa)-.55 G(ac)109.22660 Q(ck)114.228 60 Q(ka)118.67 60 Q(ag)124.232 60 Q(ge)129.234 60 Q 326.978(eP)134.236 60 S(PS)465.656 60 Q(S1)471.768 60 Q(1:)477.33 60 Q(:1)482.332 60 Q(19)485.664 60 Q(9-)490.666 60 Q(-7)495.668 60 Q(7)499 60 Q/F1 10/Times-Roman@0 SF.805(Add the character)97 96 R/F2 10/Times-Italic@0 SF -.15(ch)3.306 G F1 .806(on the windo)3.456 F 3.306(wa)-.25 G 3.306(tt)254.14 96 S .806(he current \(y)263.006 96 R 2.5(,x)-.65 G 3.306(\)c)325.058 96 S 3.306(o-ordinates. If)336.13496 R .806(the character is a ne)3.306 F(wline)-.25 E 1.063(\(\264\\n\264\) the line will be cleared to the end, and the current \(y)97108 R 2.5(,x)-.65 G 3.563(\)c)351.546 108 S 1.062(o-ordinates will be changed to the)362.879 108 R(be)97 120 Q .221(ginning of)-.15 F 2.721(ft)-.25 G .222(he ne)156.482 120 R .222(xt line if ne)-.15 F .222(wline mapping is on, or to the ne)-.25 F .222(xt line at the same x co-ordinate if it)-.15 F 1.682(is of)97 132 R 4.182(f. A)-.25 F 1.682(return \(\264\\r\264\) will mo)4.182 F 1.982 -.15(ve t)-.15H 4.182(ot).15 G 1.682(he be)252.106 132 R 1.681(ginning of the line on the windo)-.15 F 5.481 -.65(w. T)-.25 H 1.681(abs \(\264\\t\264\) will be)-.15 F -.15(ex)97 144 S .093(panded into spaces in the normal tabstop positions of e).15 F -.15(ve)-.25 G.093(ry eight characters.).15 F .093(This returns ERR if it)5.093 F -.1(wo)97156 S(uld cause the screen to scroll ille).1 E -.05(ga)-.15 G(lly).05 E(.)-.65E/F3 10/Courier-Bold@0 SF(addstr)72 184.2 Q F1(\()A F2 -.15(ch)C(ar).15 E/F4 10/Symbol SF(*)2.5 E F2(str)A F1<293b87>A .164(Add the string pointed to by)97200.4 R F2(str)2.664 E F1 .163(on the windo)2.663 F 2.663(wa)-.25 G 2.663(tt)292.826 200.4 S .163(he current \(y)301.049 200.4 R 2.5(,x)-.65 G 2.663(\)c)361.815 200.4 S 2.663(o-ordinates. This)372.248 200.4 R .163(returns ERR if)2.663 F(it w)97 212.4 Q(ould cause the screen to scroll ille)-.1 E -.05(ga)-.15G(lly).05 E 5(.I)-.65 G 2.5(nt)277.69 212.4 S(his case, it will put on as much as it can.)287.97 212.4 Q F3(baudrate)72240.6 Q F1<28293b87>A 2.353(Returns the output baud rate of the terminal.)97256.8 R 2.354(This is a system dependent constant \(def)7.353 F 2.354(ined in)-.2 F F0 -5.698(<<)97 268.8 S -3.888(ss)5.698 G -4.998(yy)3.888 G -3.888(ss)4.998 G -2.778(//)3.888 G -3.328(tt)2.778 G -3.328(tt)3.328 G 6.796 -4.998(yy .)3.328 H(.h)2.5 E(h>)131.74 268.8 Q(>)137.302 268.8 Q F1(on BSD systems, which is included by)2.5 E F0 -5.698(<<)2.5 G -4.438(cc)5.698G -5.558(uu)4.438 G -4.438(rr)5.558 G -3.888(ss)4.438 G -4.438(ee)3.888 G-3.888(ss)4.438 G -2.498(..)3.888 G -5.558(hh)2.498 G -5.698(>>)5.558 G F1(\).)5.698 E F3(box)72 297 Q F1(\()A F2(WINDO)A 2.5(Ww)-.5 G(in)143.1 297 Q F1(,)AF2 -.15(ch)2.5 G(ar vert).15 E F1(,)A F2 -.15(ch)2.5 G(ar hor).15 E F1(\);)A(Dra)97 313.2 Q .079(ws a box around the windo)-.15 F 2.579(wu)-.25 G(sing)234.824 313.2 Q F2(vert)2.578 E F1 .078(as the character for dra)2.578 F .078(wing the v)-.15 F .078(ertical sides, and)-.15 F F2(hor)2.578 E F1(for)2.578 E(dra)97 325.2 Q 1.58(wing the horizontal lines.)-.15 F 1.58(If scrolling is not allo)6.58 F 1.58(wed, and the windo)-.25 F 4.08(we)-.25 G1.58(ncompasses the lo)413.33 325.2 R(wer)-.25 E(right-hand corner of the terminal, the corners are left blank to a)97 337.2 Q-.2(vo)-.2 G(id a scroll.).2 E F3(cbreak)72 365.4 Q F1<28293b87>A(Set or the terminal to cbreak mode.)97 381.6 Q F3(clear)72 409.8 Q F1<28293b87>A 1.131(Resets the entire windo)97 426 R 3.631(wt)-.25 G 3.631(ob)207.374 426 S 3.631(lanks. If)221.005 426 R F2(win)3.631 E F1 1.13(is a screen, this sets the clear flag, which will cause a)3.631 F(clear)97 438Q .469(-screen sequence to be sent on the ne)-.2 F(xt)-.15 E F3(refresh)2.969 EF1 .469(\(\) call.)B .47(This also mo)5.469 F -.15(ve)-.15 G 2.97(st).15 G .47(he current \(y)423.55 438 R 2.5(,x)-.65 G 2.97(\)c)484.93 438 S(o-)495.67 438Q(ordinates to \(0, 0\).)97 450 Q F3(clearok)72 478.2 Q F1(\()A F2(WINDO)A(W)-.5 E F4(*)2.5 E F2(scr)A F1(,)A F2(int boolf)2.5 E F1<293b87>A .444(Sets the clear flag for the screen)97 494.4 R F2(scr)2.943 E F1 5.443(.I)C(f)254.387 494.4 Q F2(boolf)2.943 E F1 .443(is non-zero, this will force a clear)2.943 F .443(-screen to be printed)-.2 F 1.33(on the ne)97 506.4 R(xt)-.15 E F3

⌨️ 快捷键说明

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