video.inc 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  1. {
  2. System independent low-level video interface for linux
  3. $Id$
  4. }
  5. uses
  6. Linux, Strings, FileCtrl, TermInfo;
  7. var
  8. LastCursorType : byte;
  9. TtyFd: Longint;
  10. Console: Boolean;
  11. OldVideoBuf: PVideoBuf;
  12. {$ifdef logging}
  13. f: file;
  14. const
  15. logstart: string = '';
  16. nl: char = #10;
  17. logend: string = #10#10;
  18. {$endif logging}
  19. {$ASMMODE ATT}
  20. const
  21. can_delete_term : boolean = false;
  22. ACSIn : string = '';
  23. ACSOut : string = '';
  24. function IsACS(var ch,ACSchar : char): boolean;
  25. begin
  26. IsACS:=false;
  27. case ch of
  28. #24, #30: {}
  29. ch:='^';
  30. #25, #31: {}
  31. ch:='v';
  32. #26, #16: {Never introduce a ctrl-Z ... }
  33. ch:='>';
  34. {#27,needed in Escape sequences} #17: {}
  35. ch:='<';
  36. #176, #177, #178: {°±²}
  37. begin
  38. IsACS:=true;
  39. ACSChar:='a';
  40. end;
  41. #180, #181, #182, #185: {´µ¶¹}
  42. begin
  43. IsACS:=true;
  44. ACSChar:='u';
  45. end;
  46. #183, #184, #187, #191: {·¸»¿}
  47. begin
  48. IsACS:=true;
  49. ACSChar:='k';
  50. end;
  51. #188, #189, #190, #217: {¼½¾Ù}
  52. begin
  53. IsACS:=true;
  54. ACSChar:='j';
  55. end;
  56. #192, #200, #211, #212: {ÀÈÓÔ}
  57. begin
  58. IsACS:=true;
  59. ACSChar:='m';
  60. end;
  61. #193, #202, #207, #208: {ÁÊÏÐ}
  62. begin
  63. IsACS:=true;
  64. ACSChar:='v';
  65. end;
  66. #194, #203, #209, #210: {ÂËÑÒ}
  67. begin
  68. IsACS:=true;
  69. ACSChar:='w';
  70. end;
  71. #195, #198, #199, #204: {ÃÆÇÌ}
  72. begin
  73. IsACS:=true;
  74. ACSChar:='t';
  75. end;
  76. #196, #205: {ÄÍ}
  77. begin
  78. IsACS:=true;
  79. ACSChar:='q';
  80. end;
  81. #179, #186: {³º}
  82. begin
  83. IsACS:=true;
  84. ACSChar:='x';
  85. end;
  86. #197, #206, #215, #216: {ÅÎר}
  87. begin
  88. IsACS:=true;
  89. ACSChar:='n';
  90. end;
  91. #201, #213, #214, #218: {ÉÕÖÚ}
  92. begin
  93. IsACS:=true;
  94. ACSChar:='l';
  95. end;
  96. end;
  97. end;
  98. procedure SendEscapeSeqNdx(Ndx: Word);
  99. var
  100. P,pdelay: PChar;
  101. begin
  102. if not assigned(cur_term_Strings) then
  103. RunError(219);
  104. P:=cur_term_Strings^[Ndx];
  105. if assigned(p) then
  106. begin { Do not transmit the delays }
  107. pdelay:=strpos(p,'$<');
  108. if assigned(pdelay) then
  109. pdelay^:=#0;
  110. fdWrite(TTYFd, P^, StrLen(P));
  111. if assigned(pdelay) then
  112. pdelay^:='$';
  113. end;
  114. end;
  115. procedure SendEscapeSeq(const S: String);
  116. begin
  117. fdWrite(TTYFd, S[1], Length(S));
  118. end;
  119. Function IntStr(l:longint):string;
  120. var
  121. s : string;
  122. begin
  123. Str(l,s);
  124. IntStr:=s;
  125. end;
  126. Function XY2Ansi(x,y,ox,oy:longint):String;
  127. {
  128. Returns a string with the escape sequences to go to X,Y on the screen
  129. }
  130. Begin
  131. if y=oy then
  132. begin
  133. if x=ox then
  134. begin
  135. XY2Ansi:='';
  136. exit;
  137. end;
  138. if x=1 then
  139. begin
  140. XY2Ansi:=#13;
  141. exit;
  142. end;
  143. if x>ox then
  144. begin
  145. XY2Ansi:=#27'['+IntStr(x-ox)+'C';
  146. exit;
  147. end
  148. else
  149. begin
  150. XY2Ansi:=#27'['+IntStr(ox-x)+'D';
  151. exit;
  152. end;
  153. end;
  154. if x=ox then
  155. begin
  156. if y>oy then
  157. begin
  158. XY2Ansi:=#27'['+IntStr(y-oy)+'B';
  159. exit;
  160. end
  161. else
  162. begin
  163. XY2Ansi:=#27'['+IntStr(oy-y)+'A';
  164. exit;
  165. end;
  166. end;
  167. if (x=1) and (oy+1=y) then
  168. XY2Ansi:=#13#10
  169. else
  170. XY2Ansi:=#27'['+IntStr(y)+';'+IntStr(x)+'H';
  171. End;
  172. const
  173. AnsiTbl : string[8]='04261537';
  174. Function Attr2Ansi(Attr,OAttr:longint):string;
  175. {
  176. Convert Attr to an Ansi String, the Optimal code is calculate
  177. with use of the old OAttr
  178. }
  179. var
  180. hstr : string[16];
  181. OFg,OBg,Fg,Bg : longint;
  182. procedure AddSep(ch:char);
  183. begin
  184. if length(hstr)>0 then
  185. hstr:=hstr+';';
  186. hstr:=hstr+ch;
  187. end;
  188. begin
  189. if Attr=OAttr then
  190. begin
  191. Attr2Ansi:='';
  192. exit;
  193. end;
  194. Hstr:='';
  195. Fg:=Attr and $f;
  196. Bg:=Attr shr 4;
  197. OFg:=OAttr and $f;
  198. OBg:=OAttr shr 4;
  199. if (OFg<>7) or (Fg=7) or ((OFg>7) and (Fg<8)) or ((OBg>7) and (Bg<8)) then
  200. begin
  201. hstr:='0';
  202. OFg:=7;
  203. OBg:=0;
  204. end;
  205. if (Fg>7) and (OFg<8) then
  206. begin
  207. AddSep('1');
  208. OFg:=OFg or 8;
  209. end;
  210. if (Bg and 8)<>(OBg and 8) then
  211. begin
  212. AddSep('5');
  213. OBg:=OBg or 8;
  214. end;
  215. if (Fg<>OFg) then
  216. begin
  217. AddSep('3');
  218. hstr:=hstr+AnsiTbl[(Fg and 7)+1];
  219. end;
  220. if (Bg<>OBg) then
  221. begin
  222. AddSep('4');
  223. hstr:=hstr+AnsiTbl[(Bg and 7)+1];
  224. end;
  225. if hstr='0' then
  226. hstr:='';
  227. Attr2Ansi:=#27'['+hstr+'m';
  228. end;
  229. procedure TransformUsingACS(var st : string);
  230. var
  231. is_acs : boolean;
  232. res : string;
  233. i : longint;
  234. ch,ACSch : char;
  235. begin
  236. is_acs:=false;
  237. res:='';
  238. for i:=1 to length(st) do
  239. begin
  240. ch:=st[i];
  241. if IsACS(ch,ACSch) then
  242. begin
  243. if not is_acs then
  244. begin
  245. res:=res+ACSIn;
  246. is_acs:=true;
  247. end;
  248. res:=res+ACSch;
  249. end
  250. else
  251. begin
  252. if is_acs then
  253. begin
  254. res:=res+ACSOut;
  255. is_acs:=false;
  256. end;
  257. res:=res+ch;
  258. end;
  259. end;
  260. if is_acs then
  261. res:=res+ACSout;
  262. st:=res;
  263. end;
  264. procedure UpdateTTY(Force:boolean);
  265. type
  266. tchattr=packed record
  267. ch : char;
  268. attr : byte;
  269. end;
  270. var
  271. outbuf : array[0..1023+255] of char;
  272. chattr : tchattr;
  273. skipped : boolean;
  274. outptr,
  275. spaces,
  276. eol,
  277. LastX,LastY,
  278. x,y,
  279. SpaceAttr,
  280. LastAttr : longint;
  281. p,pold : pvideocell;
  282. procedure outdata(hstr:string);
  283. begin
  284. while (eol>0) do
  285. begin
  286. hstr:=#13#10+hstr;
  287. dec(eol);
  288. end;
  289. if NoExtendedFrame and (ACSIn<>'') and (ACSOut<>'') then
  290. TransformUsingACS(Hstr);
  291. move(hstr[1],outbuf[outptr],length(hstr));
  292. inc(outptr,length(hstr));
  293. if outptr>=1024 then
  294. begin
  295. {$ifdef logging}
  296. blockwrite(f,logstart[1],length(logstart));
  297. blockwrite(f,nl,1);
  298. blockwrite(f,outptr,sizeof(outptr));
  299. blockwrite(f,nl,1);
  300. blockwrite(f,outbuf,outptr);
  301. blockwrite(f,nl,1);
  302. {$endif logging}
  303. fdWrite(TTYFd,outbuf,outptr);
  304. outptr:=0;
  305. end;
  306. end;
  307. procedure OutClr(c:byte);
  308. begin
  309. if c=LastAttr then
  310. exit;
  311. OutData(Attr2Ansi(c,LastAttr));
  312. LastAttr:=c;
  313. end;
  314. procedure OutSpaces;
  315. begin
  316. if (Spaces=0) then
  317. exit;
  318. OutClr(SpaceAttr);
  319. OutData(Space(Spaces));
  320. LastX:=x;
  321. LastY:=y;
  322. Spaces:=0;
  323. end;
  324. begin
  325. OutPtr:=0;
  326. Eol:=0;
  327. skipped:=true;
  328. p:=PVideoCell(VideoBuf);
  329. pold:=PVideoCell(OldVideoBuf);
  330. { init Attr and X,Y }
  331. SendEscapeSeq(#27'[m'#27'[H');
  332. LastAttr:=7;
  333. LastX:=1;
  334. LastY:=1;
  335. for y:=1 to ScreenHeight do
  336. begin
  337. SpaceAttr:=0;
  338. Spaces:=0;
  339. for x:=1 to ScreenWidth do
  340. begin
  341. if (not force) and (p^=pold^) then
  342. begin
  343. if (Spaces>0) then
  344. OutSpaces;
  345. skipped:=true;
  346. end
  347. else
  348. begin
  349. if skipped then
  350. begin
  351. OutData(XY2Ansi(x,y,LastX,LastY));
  352. LastX:=x;
  353. LastY:=y;
  354. skipped:=false;
  355. end;
  356. chattr:=tchattr(p^);
  357. if chattr.ch in [#0,#255] then
  358. chattr.ch:=' ';
  359. if chattr.ch=' ' then
  360. begin
  361. if Spaces=0 then
  362. SpaceAttr:=chattr.Attr;
  363. if (chattr.attr and $f0)=(spaceattr and $f0) then
  364. chattr.Attr:=SpaceAttr
  365. else
  366. begin
  367. OutSpaces;
  368. SpaceAttr:=chattr.Attr;
  369. end;
  370. inc(Spaces);
  371. end
  372. else
  373. begin
  374. if (Spaces>0) then
  375. OutSpaces;
  376. if ord(chattr.ch)<32 then
  377. begin
  378. Chattr.Attr:= $ff xor Chattr.Attr;
  379. ChAttr.ch:= chr(ord(chattr.ch)+$30);
  380. end;
  381. if LastAttr<>chattr.Attr then
  382. OutClr(chattr.Attr);
  383. OutData(chattr.ch);
  384. LastX:=x+1;
  385. LastY:=y;
  386. end;
  387. p^:=tvideocell(chattr);
  388. end;
  389. inc(p);
  390. inc(pold);
  391. end;
  392. if (Spaces>0) then
  393. OutSpaces;
  394. if force then
  395. inc(eol);
  396. end;
  397. eol:=0;
  398. OutData(XY2Ansi(CursorX,CursorY,LastX,LastY));
  399. {$ifdef logging}
  400. blockwrite(f,logstart[1],length(logstart));
  401. blockwrite(f,nl,1);
  402. blockwrite(f,outptr,sizeof(outptr));
  403. blockwrite(f,nl,1);
  404. blockwrite(f,outbuf,outptr);
  405. blockwrite(f,nl,1);
  406. {$endif logging}
  407. fdWrite(TTYFd,outbuf,outptr);
  408. end;
  409. var
  410. InitialVideoTio, preInitVideoTio, postInitVideoTio: linux.termios;
  411. inputRaw, outputRaw: boolean;
  412. procedure saveRawSettings(const tio: linux.termios);
  413. Begin
  414. with tio do
  415. begin
  416. inputRaw :=
  417. ((c_iflag and (IGNBRK or BRKINT or PARMRK or ISTRIP or
  418. INLCR or IGNCR or ICRNL or IXON)) = 0) and
  419. ((c_lflag and (ECHO or ECHONL or ICANON or ISIG or IEXTEN)) = 0);
  420. outPutRaw :=
  421. ((c_oflag and OPOST) = 0) and
  422. ((c_cflag and (CSIZE or PARENB)) = 0) and
  423. ((c_cflag and CS8) <> 0);
  424. end;
  425. end;
  426. procedure restoreRawSettings(tio: linux.termios);
  427. begin
  428. with tio do
  429. begin
  430. if inputRaw then
  431. begin
  432. c_iflag := c_iflag and (not (IGNBRK or BRKINT or PARMRK or ISTRIP or
  433. INLCR or IGNCR or ICRNL or IXON));
  434. c_lflag := c_lflag and
  435. (not (ECHO or ECHONL or ICANON or ISIG or IEXTEN));
  436. end;
  437. if outPutRaw then
  438. begin
  439. c_oflag := c_oflag and not(OPOST);
  440. c_cflag := c_cflag and not(CSIZE or PARENB) or CS8;
  441. end;
  442. end;
  443. TCSetAttr(1,TCSANOW,tio);
  444. end;
  445. procedure TargetEntry;
  446. begin
  447. TCGetAttr(1,InitialVideoTio);
  448. end;
  449. procedure TargetExit;
  450. begin
  451. TCSetAttr(1,TCSANOW,InitialVideoTio);
  452. end;
  453. procedure prepareInitVideo;
  454. begin
  455. TCGetAttr(1,preInitVideoTio);
  456. saveRawSettings(preInitVideoTio);
  457. end;
  458. procedure videoInitDone;
  459. begin
  460. TCGetAttr(1,postInitVideoTio);
  461. restoreRawSettings(postInitVideoTio);
  462. end;
  463. procedure prepareDoneVideo;
  464. var
  465. tio: linux.termios;
  466. begin
  467. TCGetAttr(1,tio);
  468. saveRawSettings(tio);
  469. TCSetAttr(1,TCSANOW,postInitVideoTio);
  470. end;
  471. procedure doneVideoDone;
  472. begin
  473. restoreRawSettings(preInitVideoTio);
  474. end;
  475. procedure InitVideo;
  476. const
  477. fontstr : string[3]=#27'(K';
  478. var
  479. ThisTTY: String[30];
  480. FName: String;
  481. WS: packed record
  482. ws_row, ws_col, ws_xpixel, ws_ypixel: Word;
  483. end;
  484. Err: Longint;
  485. prev_term : TerminalCommon_ptr1;
  486. begin
  487. {$ifndef CPUI386}
  488. LowAscii:=false;
  489. {$endif CPUI386}
  490. if VideoBufSize<>0 then
  491. begin
  492. clearscreen;
  493. if Console then
  494. SetCursorPos(1,1)
  495. else
  496. begin
  497. SendEscapeSeqNdx(cursor_home);
  498. SendEscapeSeq(#27'[H');
  499. end;
  500. exit;
  501. end;
  502. { check for tty }
  503. ThisTTY:=TTYName(stdin);
  504. if IsATTY(stdin) then
  505. begin
  506. { save current terminal characteristics and remove rawness }
  507. prepareInitVideo;
  508. { write code to set a correct font }
  509. fdWrite(stdout,fontstr[1],length(fontstr));
  510. { running on a tty, find out whether locally or remotely }
  511. if (Copy(ThisTTY, 1, 8) = '/dev/tty') and
  512. (ThisTTY[9] >= '0') and (ThisTTY[9] <= '9') then
  513. begin
  514. { running on the console }
  515. FName:='/dev/vcsa' + ThisTTY[9];
  516. TTYFd:=OpenFile(FName, filReadWrite); { open console }
  517. end
  518. else
  519. TTYFd:=-1;
  520. if TTYFd<>-1 then
  521. Console:=true
  522. else
  523. begin
  524. { running on a remote terminal, no error with /dev/vcsa }
  525. Console:=False;
  526. LowAscii:=false;
  527. TTYFd:=stdout;
  528. end;
  529. ioctl(stdin, TIOCGWINSZ, @WS);
  530. if WS.ws_Col=0 then
  531. WS.ws_Col:=80;
  532. if WS.ws_Row=0 then
  533. WS.ws_Row:=25;
  534. ScreenWidth:=WS.ws_Col;
  535. { TDrawBuffer only has FVMaxWidth elements
  536. larger values lead to crashes }
  537. if ScreenWidth> FVMaxWidth then
  538. ScreenWidth:=FVMaxWidth;
  539. ScreenHeight:=WS.ws_Row;
  540. CursorX:=1;
  541. CursorY:=1;
  542. ScreenColor:=True;
  543. { allocate pmode memory buffer }
  544. VideoBufSize:=ScreenWidth*ScreenHeight*2;
  545. GetMem(VideoBuf,VideoBufSize);
  546. GetMem(OldVideoBuf,VideoBufSize);
  547. { Start with a clear screen }
  548. if not Console then
  549. begin
  550. prev_term:=cur_term;
  551. setupterm(nil, stdout, err);
  552. can_delete_term:=assigned(prev_term) and (prev_term<>cur_term);
  553. SendEscapeSeqNdx(cursor_home);
  554. SendEscapeSeqNdx(cursor_normal);
  555. SendEscapeSeqNdx(cursor_visible);
  556. SendEscapeSeqNdx(enter_ca_mode);
  557. SetCursorType(crUnderLine);
  558. end
  559. else if not assigned(cur_term) then
  560. begin
  561. setupterm(nil, stdout, err);
  562. can_delete_term:=false;
  563. end;
  564. if assigned(cur_term_Strings) then
  565. begin
  566. ACSIn:=StrPas(cur_term_Strings^[enter_alt_charset_mode]);
  567. ACSOut:=StrPas(cur_term_Strings^[exit_alt_charset_mode]);
  568. end
  569. else
  570. begin
  571. ACSIn:='';
  572. ACSOut:='';
  573. end;
  574. ClearScreen;
  575. {$ifdef logging}
  576. assign(f,'video.log');
  577. rewrite(f,1);
  578. {$endif logging}
  579. { save new terminal characteristics and possible restore rawness }
  580. videoInitDone;
  581. end
  582. else
  583. ErrorCode:=errVioInit; { not a TTY }
  584. end;
  585. procedure DoneVideo;
  586. begin
  587. if VideoBufSize=0 then
  588. exit;
  589. prepareDoneVideo;
  590. ClearScreen;
  591. if Console then
  592. SetCursorPos(1,1)
  593. else
  594. begin
  595. SendEscapeSeqNdx(exit_ca_mode);
  596. SendEscapeSeqNdx(cursor_home);
  597. SendEscapeSeqNdx(cursor_normal);
  598. SendEscapeSeqNdx(cursor_visible);
  599. SetCursorType(crUnderLine);
  600. SendEscapeSeq(#27'[H');
  601. end;
  602. FreeMem(VideoBuf,VideoBufSize);
  603. FreeMem(OldVideoBuf,VideoBufSize);
  604. VideoBufSize:=0;
  605. ACSIn:='';
  606. ACSOut:='';
  607. doneVideoDone;
  608. if can_delete_term then
  609. begin
  610. del_curterm(cur_term);
  611. can_delete_term:=false;
  612. end;
  613. {$ifdef logging}
  614. close(f);
  615. {$endif logging}
  616. end;
  617. procedure ClearScreen;
  618. begin
  619. FillWord(VideoBuf^,VideoBufSize shr 1,$0720);
  620. if Console then
  621. UpdateScreen(true)
  622. else
  623. begin
  624. SendEscapeSeq(#27'[0m');
  625. SendEscapeSeqNdx(clear_screen);
  626. end;
  627. end;
  628. procedure UpdateScreen(Force: Boolean);
  629. var
  630. DoUpdate : boolean;
  631. begin
  632. if LockUpdateScreen<>0 then
  633. exit;
  634. if not force then
  635. begin
  636. {$ifdef i386}
  637. asm
  638. movl VideoBuf,%esi
  639. movl OldVideoBuf,%edi
  640. movl VideoBufSize,%ecx
  641. shrl $2,%ecx
  642. repe
  643. cmpsl
  644. orl %ecx,%ecx
  645. setne DoUpdate
  646. end;
  647. {$endif i386}
  648. end
  649. else
  650. DoUpdate:=true;
  651. if not DoUpdate then
  652. exit;
  653. if Console then
  654. begin
  655. fdSeek(TTYFd, 4, skBeg);
  656. fdWrite(TTYFd, VideoBuf^,VideoBufSize);
  657. end
  658. else
  659. begin
  660. UpdateTTY(force);
  661. end;
  662. Move(VideoBuf^, OldVideoBuf^, VideoBufSize);
  663. end;
  664. function GetCapabilities: Word;
  665. begin
  666. { about cpColor... we should check the terminfo database... }
  667. GetCapabilities:=cpUnderLine + cpBlink + cpColor;
  668. end;
  669. procedure SetCursorPos(NewCursorX, NewCursorY: Word);
  670. var
  671. Pos : array [1..2] of Byte;
  672. begin
  673. if Console then
  674. begin
  675. fdSeek(TTYFd, 2, skBeg);
  676. Pos[1]:=NewCursorX;
  677. Pos[2]:=NewCursorY;
  678. fdWrite(TTYFd, Pos, 2);
  679. end
  680. else
  681. begin
  682. { newcursorx,y is 0 based ! }
  683. SendEscapeSeq(XY2Ansi(NewCursorX+1,NewCursorY+1,0,0));
  684. end;
  685. CursorX:=NewCursorX+1;
  686. CursorY:=NewCursorY+1;
  687. end;
  688. function GetCursorType: Word;
  689. begin
  690. GetCursorType:=LastCursorType;
  691. end;
  692. procedure SetCursorType(NewType: Word);
  693. begin
  694. LastCursorType:=NewType;
  695. case NewType of
  696. crBlock :
  697. SendEscapeSeq(#27'[?17;0;64c');
  698. crHidden :
  699. SendEscapeSeq(#27'[?1c');
  700. else
  701. SendEscapeSeq(#27'[?2c');
  702. end;
  703. end;
  704. function DefaultVideoModeSelector(const VideoMode: TVideoMode; Params: Longint): Boolean;
  705. begin
  706. DefaultVideoModeSelector:=false;
  707. end;
  708. procedure RegisterVideoModes;
  709. begin
  710. end;
  711. {
  712. $Log$
  713. Revision 1.3 2000-11-13 17:22:22 pierre
  714. merge NoExtendedFrame
  715. <<<<<<< video.inc
  716. Revision 1.2 2000/10/26 23:08:48 peter
  717. * merged freebsd from fixes
  718. =======
  719. Revision 1.1.2.2 2000/11/09 08:50:36 pierre
  720. + support for terms with only one graphic set
  721. >>>>>>> 1.1.2.2
  722. Revision 1.1.2.1 2000/10/25 12:23:20 marco
  723. * Linux dir split up
  724. Revision 1.1.2.11 2000/10/19 07:28:18 pierre
  725. * do not transmit the delay part in terminfo strings
  726. Revision 1.1.2.10 2000/10/13 15:09:40 pierre
  727. * Handle zero size for term correctly
  728. Revision 1.1.2.9 2000/10/10 16:39:44 pierre
  729. + transform low ascii chars by changing their colors and adding 48
  730. Revision 1.1.2.8 2000/10/10 15:34:58 pierre
  731. * fixe a bug in Attr2Ansi
  732. Revision 1.1.2.7 2000/10/10 10:52:56 pierre
  733. + FVMaxWidth to avoid too wide screens
  734. Revision 1.1.2.6 2000/10/09 21:57:42 pierre
  735. * Set LowAscii to false only if not on a local tty
  736. Revision 1.1.2.5 2000/10/09 16:29:15 pierre
  737. * more linux terminal fixes
  738. Revision 1.1.2.4 2000/10/04 11:44:33 pierre
  739. add TargetEntry and TargetExit procedures (needed for linux)
  740. Revision 1.1.2.3 2000/10/03 22:31:29 pierre
  741. * avoid invalid cur_term var
  742. Revision 1.1.2.2 2000/09/25 13:21:19 jonas
  743. + added preserving of rawness of terminal when going though
  744. init/donevideo
  745. * del_term() is now called in donevideo
  746. * if initvideo is called while the video is already iniialized, the
  747. screen is cleared and the cursor is set home, instead of going
  748. through the whole donevideo and then initvideo
  749. Revision 1.1.2.1 2000/08/02 12:29:06 jonas
  750. * fixed crashes under ncurses 4 by adding auto-detection for ncurses 4/5
  751. * cur_term is not directly usable anymore for the largest part because
  752. of a different record layout in ncurses 4/5, therefore the pointers
  753. cur_term_booleans, cur_term_numbers, cur_term_strings and
  754. cur_term_common are now available
  755. * adapted video.inc to use the new naming convention
  756. Revision 1.1 2000/07/13 06:29:39 michael
  757. + Initial import
  758. Revision 1.3 2000/06/30 12:28:57 jonas
  759. * fixed termtype structure
  760. Revision 1.2 2000/03/12 15:02:10 peter
  761. * removed unused var
  762. Revision 1.1 2000/01/06 01:20:31 peter
  763. * moved out of packages/ back to topdir
  764. Revision 1.1 1999/11/24 23:36:38 peter
  765. * moved to packages dir
  766. Revision 1.5 1999/07/05 21:38:19 peter
  767. * works now also on not /dev/tty* units
  768. * if col,row is 0,0 then take 80x25 by default
  769. Revision 1.4 1999/02/22 12:46:16 peter
  770. + lowascii boolean if ascii < #32 is handled correctly
  771. Revision 1.3 1999/02/08 10:34:26 peter
  772. * cursortype futher implemented
  773. Revision 1.2 1998/12/12 19:13:03 peter
  774. * keyboard updates
  775. * make test target, make all only makes units
  776. Revision 1.1 1998/12/04 12:48:30 peter
  777. * moved some dirs
  778. Revision 1.6 1998/12/03 10:18:07 peter
  779. * tty fixed
  780. Revision 1.5 1998/12/01 15:08:17 peter
  781. * fixes for linux
  782. Revision 1.4 1998/11/01 20:29:12 peter
  783. + lockupdatescreen counter to not let updatescreen() update
  784. Revision 1.3 1998/10/29 12:49:50 peter
  785. * more fixes
  786. Revision 1.1 1998/10/26 11:31:47 peter
  787. + inital include files
  788. }