fpusrscr.pas 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. User screen support routines
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {$i globdir.inc}
  13. unit FPUsrScr;
  14. interface
  15. uses
  16. {$ifdef win32}
  17. windows,
  18. {$endif win32}
  19. video,Objects;
  20. type
  21. PScreen = ^TScreen;
  22. TScreen = object(TObject)
  23. function GetWidth: integer; virtual;
  24. function GetHeight: integer; virtual;
  25. procedure GetLine(Line: integer; var Text, Attr: string); virtual;
  26. procedure GetCursorPos(var P: TPoint); virtual;
  27. { copy the initial video screen in the ide screen }
  28. procedure Capture; virtual;
  29. { move up or down if supported by OS }
  30. function Scroll(i : integer) : integer; virtual;
  31. { saves the current IDE screen }
  32. procedure SaveIDEScreen; virtual;
  33. { saves the current console screen }
  34. procedure SaveConsoleScreen; virtual;
  35. { restores the saved console screen }
  36. procedure SwitchToConsoleScreen; virtual;
  37. { restores the saved IDE screen }
  38. procedure SwitchBackToIDEScreen; virtual;
  39. end;
  40. {$ifdef DOS}
  41. TDOSVideoInfo = record
  42. Mode : word;
  43. ScreenSize: word;
  44. Page : byte;
  45. Rows,Cols : integer;
  46. CurPos : TPoint;
  47. CurShapeT : integer;
  48. CurShapeB : integer;
  49. StateSize : word;
  50. StateBuf : pointer;
  51. end;
  52. PDOSScreen = ^TDOSScreen;
  53. TDOSScreen = object(TScreen)
  54. constructor Init;
  55. destructor Done; virtual;
  56. public
  57. function GetWidth: integer; virtual;
  58. function GetHeight: integer; virtual;
  59. procedure GetLine(Line: integer; var Text, Attr: string); virtual;
  60. procedure GetCursorPos(var P: TPoint); virtual;
  61. procedure Capture; virtual;
  62. procedure SaveIDEScreen; virtual;
  63. procedure SaveConsoleScreen; virtual;
  64. procedure SwitchToConsoleScreen; virtual;
  65. procedure SwitchBackToIDEScreen; virtual;
  66. private
  67. ConsoleVideoInfo : TDOSVideoInfo;
  68. VBufferSize : longint;
  69. VIDEBufferSize : longint;
  70. VBuffer : PByteArray;
  71. VIDEBuffer : PByteArray;
  72. IDEVideoInfo : TDOSVideoInfo;
  73. ctrl_c_state : boolean;
  74. {$ifdef TEST_GRAPH_SWITCH}
  75. GraphImageSize : longint;
  76. GraphBuffer : pointer;
  77. ConsoleGraphDriver, ConsoleGraphMode : word;
  78. {$endif TEST_GRAPH_SWITCH}
  79. function GetLineStartOfs(Line: integer): word;
  80. procedure GetBuffer(Size: word);
  81. procedure FreeBuffer;
  82. procedure GetVideoMode(var MI: TDOSVideoInfo);
  83. procedure SetVideoMode(MI: TDOSVideoInfo);
  84. end;
  85. {$endif}
  86. {$ifdef Unix}
  87. PLinuxScreen = ^TLinuxScreen;
  88. TLinuxScreen = object(TScreen)
  89. constructor Init;
  90. destructor Done; virtual;
  91. public
  92. function GetWidth: integer; virtual;
  93. function GetHeight: integer; virtual;
  94. procedure GetLine(Line: integer; var Text, Attr: string); virtual;
  95. procedure GetCursorPos(var P: TPoint); virtual;
  96. procedure Capture; virtual;
  97. procedure SaveIDEScreen; virtual;
  98. procedure SaveConsoleScreen; virtual;
  99. procedure SwitchToConsoleScreen; virtual;
  100. procedure SwitchBackToIDEScreen; virtual;
  101. private
  102. IDE_screen: pvideobuf;
  103. IDE_size : longint;
  104. IsXterm : boolean;
  105. end;
  106. {$endif}
  107. {$ifdef win32}
  108. PWin32Screen = ^TWin32Screen;
  109. TWin32Screen = object(TScreen)
  110. constructor Init;
  111. destructor Done; virtual;
  112. public
  113. function GetWidth: integer; virtual;
  114. function GetHeight: integer; virtual;
  115. procedure GetLine(Line: integer; var Text, Attr: string); virtual;
  116. procedure GetCursorPos(var P: TPoint); virtual;
  117. function Scroll(i : integer) : integer; virtual;
  118. procedure Capture; virtual;
  119. procedure SaveIDEScreen; virtual;
  120. procedure SaveConsoleScreen; virtual;
  121. procedure SwitchToConsoleScreen; virtual;
  122. procedure SwitchBackToIDEScreen; virtual;
  123. private
  124. DosScreenBufferHandle,
  125. IDEScreenBufferHandle,
  126. StartScreenBufferHandle,
  127. DummyScreenBufferHandle,
  128. NewScreenBufferHandle : THandle;
  129. IDEActive : boolean;
  130. ConsoleMode,IdeMode : Dword;
  131. IdeScreenMode : TVideoMode;
  132. procedure BufferCopy(src,dest : THandle);
  133. end;
  134. {$endif}
  135. procedure InitUserScreen;
  136. procedure DoneUserScreen;
  137. const UserScreen : PScreen = nil;
  138. implementation
  139. uses
  140. Dos
  141. (* {$ifdef TP}
  142. {$ifdef DPMI}
  143. ,WinAPI
  144. {$endif}
  145. {$endif}*)
  146. {$ifdef FPC}
  147. {$ifdef GO32V2}
  148. ,Dpmiexcp, Go32
  149. {$endif}
  150. {$endif}
  151. ,Drivers,App
  152. {$ifdef TEST_GRAPH_SWITCH}
  153. ,Graph,VESA
  154. {$else not TEST_GRAPH_SWITCH}
  155. {$ifdef VESA}
  156. ,VESA
  157. {$endif VESA}
  158. {$endif not TEST_GRAPH_SWITCH}
  159. ;
  160. function TScreen.GetWidth: integer;
  161. begin
  162. Getwidth:=0;
  163. Abstract;
  164. end;
  165. function TScreen.GetHeight: integer;
  166. begin
  167. Getheight:=0;
  168. Abstract;
  169. end;
  170. procedure TScreen.GetLine(Line: integer; var Text, Attr: string);
  171. begin
  172. Abstract;
  173. end;
  174. procedure TScreen.GetCursorPos(var P: TPoint);
  175. begin
  176. Abstract;
  177. end;
  178. procedure TScreen.Capture;
  179. begin
  180. Abstract;
  181. end;
  182. procedure TScreen.SwitchToConsoleScreen;
  183. begin
  184. Abstract;
  185. end;
  186. procedure TScreen.SwitchBackToIDEScreen;
  187. begin
  188. Abstract;
  189. end;
  190. procedure TScreen.SaveIDEScreen;
  191. begin
  192. Abstract;
  193. end;
  194. function TScreen.Scroll(i : integer) : integer;
  195. begin
  196. Scroll:=0;
  197. end;
  198. procedure TScreen.SaveConsoleScreen;
  199. begin
  200. Abstract;
  201. end;
  202. {****************************************************************************
  203. TDOSScreen
  204. ****************************************************************************}
  205. {$ifdef DOS}
  206. constructor TDOSScreen.Init;
  207. begin
  208. inherited Init;
  209. Capture;
  210. { get the current ctrl-C state }
  211. Ctrl_c_state:=djgpp_set_ctrl_c(false);
  212. djgpp_set_ctrl_c(Ctrl_c_state);
  213. end;
  214. destructor TDOSScreen.Done;
  215. begin
  216. FreeBuffer;
  217. if assigned(VIDEBuffer) then
  218. FreeMem(VIDEBuffer,VIDEBufferSize);
  219. inherited Done;
  220. end;
  221. function TDOSScreen.GetWidth: integer;
  222. begin
  223. GetWidth:=ConsoleVideoInfo.Cols;
  224. end;
  225. function TDOSScreen.GetHeight: integer;
  226. begin
  227. GetHeight:=ConsoleVideoInfo.Rows;
  228. end;
  229. procedure TDOSScreen.GetLine(Line: integer; var Text, Attr: string);
  230. var X: integer;
  231. W: word;
  232. begin
  233. Text:=''; Attr:='';
  234. if Line<GetHeight then
  235. begin
  236. W:=GetLineStartOfs(Line);
  237. for X:=0 to GetWidth-1 do
  238. begin
  239. {Text:=Text+chr(VBuffer^[W+X*2]);
  240. Attr:=Attr+chr(VBuffer^[W+X*2+1]);}
  241. System.Insert(chr(VBuffer^[W+X*2]),Text,Length(Text)+1);
  242. System.Insert(chr(VBuffer^[W+X*2+1]),Attr,Length(Attr)+1);
  243. end;
  244. end;
  245. end;
  246. procedure TDOSScreen.GetCursorPos(var P: TPoint);
  247. begin
  248. P:=ConsoleVideoInfo.CurPos;
  249. end;
  250. procedure TDOSScreen.Capture;
  251. begin
  252. SaveConsoleScreen;
  253. end;
  254. procedure TDosScreen.SaveIDEScreen;
  255. var
  256. VSeg,SOfs: word;
  257. begin
  258. GetVideoMode(IDEVideoInfo);
  259. { First keep a copy of IDE screen }
  260. if ConsoleVideoInfo.Mode=7 then
  261. VSeg:=SegB000
  262. else
  263. VSeg:=SegB800;
  264. SOfs:=MemW[Seg0040:$4e];
  265. if not assigned(VIDEBuffer) or (VIDEBufferSize<>IDEVideoInfo.ScreenSize) then
  266. begin
  267. if assigned(VIDEBuffer) then
  268. FreeMem(VIDEBuffer,VIDEBufferSize);
  269. GetMem(VIDEBuffer,IDEVideoInfo.ScreenSize);
  270. VIDEBufferSize:=IDEVideoInfo.ScreenSize;
  271. end;
  272. {$ifdef FPC}
  273. DosmemGet(VSeg,SOfs,VIDEBuffer^,IDEVideoInfo.ScreenSize);
  274. {$else}
  275. Move(ptr(VSeg,SOfs)^,VIDEBuffer^,IDEVideoInfo.ScreenSize);
  276. {$endif}
  277. end;
  278. procedure TDosScreen.SaveConsoleScreen;
  279. var
  280. VSeg,SOfs: word;
  281. {$ifdef TEST_GRAPH_SWITCH}
  282. saved : boolean;
  283. GraphDriver,GraphMode : integer;
  284. {$endif TEST_GRAPH_SWITCH}
  285. begin
  286. GetVideoMode(ConsoleVideoInfo);
  287. {$ifdef TEST_GRAPH_SWITCH}
  288. saved:=false;
  289. if assigned(GraphBuffer) then
  290. begin
  291. FreeMem(GraphBuffer,GraphImageSize);
  292. GraphBuffer:=nil;
  293. GraphImageSize:=0;
  294. end;
  295. if (ConsoleVideoInfo.Mode>= $100) or
  296. (ConsoleVideoInfo.Mode=$13) or
  297. (ConsoleVideoInfo.Mode=$12) or
  298. (ConsoleVideoInfo.Mode=$10) or
  299. (ConsoleVideoInfo.Mode=$E) then
  300. begin
  301. if VesaSetMode(ConsoleVideoInfo.Mode or $8000) then
  302. begin
  303. Graph.DontClearGraphMemory:=true;
  304. if ConsoleVideoInfo.Mode>=$100 then
  305. begin
  306. GraphDriver:=Graph.Vesa;
  307. GraphMode:=ConsoleVideoInfo.Mode and $fff;
  308. end
  309. else
  310. begin
  311. GraphDriver:=Graph.VGA;
  312. case ConsoleVideoInfo.Mode of
  313. $E : GraphMode:=VGALo;
  314. $10 : GraphMode:=VGAMed;
  315. $12 : GraphMode:=VGAHi;
  316. $13 : begin
  317. GraphDriver:=Graph.LowRes;
  318. GraphMode:=0;
  319. end;
  320. end;
  321. end;
  322. Graph.InitGraph(GraphDriver,GraphMode,'');
  323. if graphresult=grOk then
  324. begin
  325. ConsoleGraphDriver:=GraphDriver;
  326. ConsoleGraphMode:=GraphMode;
  327. Graph.DontClearGraphMemory:=false;
  328. GraphImageSize:=ImageSize(0,0,Graph.GetmaxX,Graph.GetMaxY);
  329. GetMem(GraphBuffer,GraphImageSize);
  330. FillChar(GraphBuffer^,GraphImageSize,#0);
  331. GetImage(0,0,Graph.GetmaxX,Graph.GetMaxY,GraphBuffer^);
  332. saved:=true;
  333. end
  334. {$ifdef DEBUG}
  335. else
  336. Writeln(stderr,'Error in InitGraph ',Graphdriver, ' ',Graphmode)
  337. {$endif DEBUG}
  338. ;
  339. end;
  340. end;
  341. { mode < $100 so use standard Save code }
  342. if not saved then
  343. {$endif TEST_GRAPH_SWITCH}
  344. begin
  345. GetBuffer(ConsoleVideoInfo.ScreenSize);
  346. if ConsoleVideoInfo.Mode=7 then
  347. VSeg:=SegB000
  348. else
  349. VSeg:=SegB800;
  350. SOfs:=MemW[Seg0040:$4e];
  351. {$ifdef FPC}
  352. DosmemGet(VSeg,SOfs,VBuffer^,ConsoleVideoInfo.ScreenSize);
  353. {$else}
  354. Move(ptr(VSeg,SOfs)^,VBuffer^,ConsoleVideoInfo.ScreenSize);
  355. {$endif}
  356. end;
  357. end;
  358. procedure TDOSScreen.SwitchToConsoleScreen;
  359. var
  360. VSeg,SOfs: word;
  361. {$ifdef TEST_GRAPH_SWITCH}
  362. restored : boolean;
  363. GraphDriver,GraphMode : integer;
  364. {$endif TEST_GRAPH_SWITCH}
  365. begin
  366. SetVideoMode(ConsoleVideoInfo);
  367. {$ifdef TEST_GRAPH_SWITCH}
  368. restored:=false;
  369. if assigned(GraphBuffer) then
  370. begin
  371. if VesaSetMode(ConsoleVideoInfo.Mode) then
  372. begin
  373. if ConsoleVideoInfo.Mode>=$100 then
  374. begin
  375. GraphDriver:=Graph.Vesa;
  376. GraphMode:=ConsoleVideoInfo.Mode and $fff;
  377. end
  378. else
  379. begin
  380. GraphDriver:=Graph.VGA;
  381. case ConsoleVideoInfo.Mode of
  382. $E : GraphMode:=VGALo;
  383. $10 : GraphMode:=VGAMed;
  384. $12 : GraphMode:=VGAHi;
  385. $13 : begin
  386. GraphDriver:=Graph.LowRes;
  387. GraphMode:=0;
  388. end;
  389. end;
  390. end;
  391. if (ConsoleGraphDriver<>GraphDriver) or
  392. (ConsoleGraphMode<>GraphMode) then
  393. Graph.InitGraph(GraphDriver,GraphMode,'');
  394. if graphresult=grOk then
  395. begin
  396. PutImage(0,0,GraphBuffer^,CopyPut);
  397. FreeMem(GraphBuffer,GraphImageSize);
  398. GraphBuffer:=nil;
  399. GraphImageSize:=0;
  400. restored:=true;
  401. end;
  402. end;
  403. end;
  404. { mode < $100 so use standard Save code }
  405. if not restored then
  406. {$endif TEST_GRAPH_SWITCH}
  407. begin
  408. if ConsoleVideoInfo.Mode=7 then
  409. VSeg:=SegB000
  410. else
  411. VSeg:=SegB800;
  412. SOfs:=MemW[Seg0040:$4e];
  413. {$ifdef FPC}
  414. DosmemPut(VSeg,SOfs,VBuffer^,ConsoleVideoInfo.ScreenSize);
  415. djgpp_set_ctrl_c(Ctrl_c_state);
  416. {$else}
  417. Move(VBuffer^,ptr(VSeg,SOfs)^,ConsoleVideoInfo.ScreenSize);
  418. {$endif}
  419. end;
  420. end;
  421. procedure TDOSScreen.SwitchBackToIDEScreen;
  422. var
  423. VSeg,SOfs: word;
  424. begin
  425. SetVideoMode(IDEVideoInfo);
  426. if ConsoleVideoInfo.Mode=7 then
  427. VSeg:=SegB000
  428. else
  429. VSeg:=SegB800;
  430. SOfs:=MemW[Seg0040:$4e];
  431. if assigned(VIDEBuffer) then
  432. {$ifdef FPC}
  433. DosmemPut(VSeg,SOfs,VIDEBuffer^,IDEVideoInfo.ScreenSize);
  434. Ctrl_c_state := djgpp_set_ctrl_c(false);
  435. {$else}
  436. Move(VIDEBuffer^,ptr(VSeg,SOfs)^,IDEVideoInfo.ScreenSize);
  437. {$endif}
  438. end;
  439. function TDOSScreen.GetLineStartOfs(Line: integer): word;
  440. begin
  441. GetLineStartOfs:=(ConsoleVideoInfo.Cols*Line)*2;
  442. end;
  443. procedure TDOSScreen.GetBuffer(Size: word);
  444. begin
  445. if (VBuffer<>nil) and (VBufferSize=Size) then Exit;
  446. if VBuffer<>nil then FreeBuffer;
  447. VBufferSize:=Size;
  448. GetMem(VBuffer,VBufferSize);
  449. end;
  450. procedure TDOSScreen.FreeBuffer;
  451. begin
  452. if (VBuffer<>nil) and (VBufferSize>0) then FreeMem(VBuffer,VBufferSize);
  453. VBuffer:=nil;
  454. end;
  455. procedure TDOSScreen.GetVideoMode(var MI: TDOSVideoInfo);
  456. var
  457. r: registers;
  458. {$ifdef TP}
  459. P: pointer;
  460. Sel: longint;
  461. (* {$I realintr.inc} *)
  462. {$endif}
  463. begin
  464. if (MI.StateSize>0) and (MI.StateBuf<>nil) then
  465. begin FreeMem(MI.StateBuf,MI.StateSize); MI.StateBuf:=nil; end;
  466. MI.ScreenSize:=MemW[Seg0040:$4c];
  467. r.ah:=$0f;
  468. intr($10,r);
  469. MI.Mode:=r.al;
  470. MI.Page:=r.bh;
  471. MI.Cols:=r.ah;
  472. {$ifdef VESA}
  473. VESAGetMode(MI.Mode);
  474. MI.Mode:=MI.Mode and $fff;
  475. {$endif}
  476. MI.Rows:=MI.ScreenSize div (MI.Cols*2);
  477. if MI.Rows=51 then MI.Rows:=50;
  478. r.ah:=$03;
  479. r.bh:=MI.Page;
  480. intr($10,r);
  481. with MI do
  482. begin
  483. CurPos.X:=r.dl; CurPos.Y:=r.dh;
  484. CurShapeT:=r.ch; CurShapeB:=r.cl;
  485. end;
  486. (*
  487. {$ifdef TP}
  488. { check VGA functions }
  489. MI.StateSize:=0;
  490. r.ah:=$1c; r.al:=0; r.cx:=7; intr($10,r);
  491. if (r.al=$1c) and ((r.flags and fCarry)=0) and (r.bx>0) then
  492. begin
  493. MI.StateSize:=r.bx;
  494. GetMem(MI.StateBuf,MI.StateSize); FillChar(MI.StateBuf^,MI.StateSize,0);
  495. P:=MI.StateBuf;
  496. {$ifdef DPMI}
  497. Sel:=GlobalDosAlloc(MI.StateSize);
  498. P:=Ptr(Sel shr 16,0);
  499. {$endif}
  500. r.ah:=$1c; r.al:=1; r.cx:=7;
  501. r.es:=PtrRec(P).Seg; r.bx:=PtrRec(P).Ofs;
  502. {$ifdef DPMI}realintr($10,r);{$else}intr($10,r);{$endif}
  503. {$ifdef DPMI}
  504. Move(Ptr(Sel and $ffff,0)^,MI.StateBuf^,MI.StateSize);
  505. GlobalDosFree(Sel and $ffff);
  506. {$endif}
  507. end;
  508. {$endif}
  509. *)
  510. end;
  511. procedure TDOSScreen.SetVideoMode(MI: TDOSVideoInfo);
  512. var r: registers;
  513. CM: TDOSVideoInfo;
  514. {$ifdef TP}
  515. P: pointer;
  516. Sel: longint;
  517. {$I realintr.inc}
  518. {$endif}
  519. begin
  520. FillChar(CM,sizeof(CM),0);
  521. GetVideoMode(CM);
  522. if (CM.Mode<>MI.Mode) or (CM.Cols<>MI.Cols) or (CM.Rows<>MI.Rows) then
  523. begin
  524. {$ifdef VESA}
  525. if MI.Mode>=$100 then
  526. VESASetMode(MI.Mode)
  527. else
  528. {$endif}
  529. begin
  530. r.ah:=$00; r.al:=MI.Mode; intr($10,r);
  531. end;
  532. if (MI.Mode=3) and (MI.Cols=80) and (MI.Rows=50) then
  533. begin
  534. r.ax:=$1112; r.bx:=$0;
  535. intr($10,r);
  536. end;
  537. end;
  538. r.ah:=$05; r.al:=MI.Page; intr($10,r);
  539. r.ah:=$02; r.bh:=MI.Page; r.dl:=MI.CurPos.X; r.dh:=MI.CurPos.Y; intr($10,r);
  540. r.ah:=$01; r.ch:=MI.CurShapeT; r.cl:=MI.CurShapeB; intr($10,r);
  541. (*
  542. {$ifdef TP}
  543. if (MI.StateSize>0) and (MI.StateBuf<>nil) then
  544. begin
  545. P:=MI.StateBuf;
  546. {$ifdef DPMI}
  547. Sel:=GlobalDosAlloc(MI.StateSize);
  548. Move(MI.StateBuf^,ptr(Sel and $ffff,0)^,MI.StateSize);
  549. P:=Ptr(Sel shr 16,0);
  550. {$endif}
  551. r.ah:=$1c; r.al:=2; r.cx:=7;
  552. r.es:=PtrRec(P).Seg; r.bx:=PtrRec(P).Ofs;
  553. {$ifdef DPMI}realintr($10,r);{$else}intr($10,r);{$endif}
  554. {$ifdef DPMI}
  555. GlobalDosFree(Sel and $ffff);
  556. {$endif}
  557. end;
  558. {$endif}
  559. *)
  560. end;
  561. {$endif}
  562. {****************************************************************************
  563. TLinuxScreen
  564. ****************************************************************************}
  565. {$ifdef Unix}
  566. constructor TLinuxScreen.Init;
  567. begin
  568. inherited Init;
  569. IDE_screen := nil;
  570. IsXterm:=getenv('TERM')='xterm';
  571. Capture;
  572. end;
  573. destructor TLinuxScreen.Done;
  574. begin
  575. inherited Done;
  576. end;
  577. function TLinuxScreen.GetWidth: integer;
  578. begin
  579. GetWidth:=ScreenWidth;
  580. end;
  581. function TLinuxScreen.GetHeight: integer;
  582. begin
  583. GetHeight:=ScreenHeight;
  584. end;
  585. procedure TLinuxScreen.GetLine(Line: integer; var Text, Attr: string);
  586. begin
  587. Text:='';
  588. Attr:='';
  589. end;
  590. procedure TLinuxScreen.GetCursorPos(var P: TPoint);
  591. begin
  592. P.X:=0;
  593. P.Y:=0;
  594. end;
  595. procedure TLinuxScreen.Capture;
  596. begin
  597. SaveConsoleScreen;
  598. end;
  599. procedure TLinuxScreen.SaveIDEScreen;
  600. begin
  601. if assigned(IDE_screen) then
  602. dispose(IDE_screen);
  603. getmem(IDE_screen,videobufsize);
  604. Ide_size:=videobufsize;
  605. move(videobuf^,IDE_screen^,videobufsize);
  606. end;
  607. procedure TLinuxScreen.SaveConsoleScreen;
  608. begin
  609. if IsXTerm then
  610. write(#27'7'#27'[?47h');
  611. end;
  612. procedure TLinuxScreen.SwitchToConsoleScreen;
  613. begin
  614. if IsXterm then
  615. begin
  616. write(#27'[0m');
  617. write(#27'[?47l'#27'8'#27'[m');
  618. end;
  619. end;
  620. procedure TLinuxScreen.SwitchBackToIDEScreen;
  621. begin
  622. if IDE_screen = nil then
  623. exit;
  624. move(IDE_screen^,videobuf^,videobufsize);
  625. freemem(IDE_screen,Ide_size);
  626. IDE_screen := nil;
  627. end;
  628. {$endif}
  629. {****************************************************************************
  630. TWin32Screen
  631. ****************************************************************************}
  632. {$ifdef win32}
  633. procedure UpdateFileHandles;
  634. begin
  635. {StdInputHandle:=longint(GetStdHandle(STD_INPUT_HANDLE));}
  636. StdOutputHandle:=longint(GetStdHandle(STD_OUTPUT_HANDLE));
  637. {StdErrorHandle:=longint(GetStdHandle(STD_ERROR_HANDLE));}
  638. TextRec(Output).Handle:=StdOutputHandle;
  639. TextRec(StdOut).Handle:=StdOutputHandle;
  640. {TextRec(StdErr).Handle:=StdErrorHandle;}
  641. end;
  642. constructor TWin32Screen.Init;
  643. var
  644. SecurityAttr : Security_attributes;
  645. BigWin : Coord;
  646. res : longbool;
  647. Error : dword;
  648. ConsoleScreenBufferInfo : Console_screen_buffer_info;
  649. begin
  650. inherited Init;
  651. {if GetConsoleOutputCP<>437 then
  652. res:=SetConsoleOutputCP(437);}
  653. SecurityAttr.nLength:=SizeOf(Security_attributes);
  654. SecurityAttr.lpSecurityDescriptor:=nil;
  655. SecurityAttr.bInheritHandle:=true;
  656. NewScreenBufferHandle:=CreateConsoleScreenBuffer(
  657. GENERIC_READ or GENERIC_WRITE,
  658. FILE_SHARE_READ or FILE_SHARE_WRITE,SecurityAttr,
  659. CONSOLE_TEXTMODE_BUFFER,nil);
  660. DummyScreenBufferHandle:=CreateConsoleScreenBuffer(
  661. GENERIC_READ or GENERIC_WRITE,
  662. FILE_SHARE_READ or FILE_SHARE_WRITE,SecurityAttr,
  663. CONSOLE_TEXTMODE_BUFFER,nil);
  664. StartScreenBufferHandle:=GetStdHandle(STD_OUTPUT_HANDLE);
  665. GetConsoleMode(GetStdHandle(Std_Input_Handle), @ConsoleMode);
  666. IdeMode:=ConsoleMode;
  667. {$ifdef debug}
  668. {define win32bigwin}
  669. {$endif debug}
  670. {$ifdef win32bigwin}
  671. GetConsoleScreenBufferInfo(StartScreenBufferHandle,
  672. @ConsoleScreenBufferInfo);
  673. BigWin.X:=ConsoleScreenBufferInfo.dwSize.X;
  674. BigWin.Y:=200;
  675. { Try to allow to store more info }
  676. res:=SetConsoleScreenBufferSize(NewScreenBufferHandle,BigWin);
  677. if not res then
  678. error:=GetLastError;
  679. res:=SetConsoleScreenBufferSize(StartScreenBufferHandle,BigWin);
  680. if not res then
  681. error:=GetLastError;
  682. {$endif win32bigwin}
  683. GetConsoleScreenBufferInfo(StartScreenBufferHandle,
  684. @ConsoleScreenBufferInfo);
  685. { make sure that the IDE Screen Handle has the maximum display size
  686. this removes the scroll bars if it is maximized }
  687. res:=SetConsoleScreenBufferSize(NewScreenBufferHandle,
  688. ConsoleScreenBufferInfo.dwMaximumWindowSize);
  689. if not res then
  690. error:=GetLastError;
  691. IDEScreenBufferHandle:=NewScreenBufferHandle;
  692. DosScreenBufferHandle:=StartScreenBufferHandle;
  693. Capture;
  694. {$ifdef fvision}
  695. if TextModeGFV then
  696. {$endif fvision}
  697. IdeScreenMode.row:=0;
  698. SwitchBackToIDEScreen;
  699. end;
  700. destructor TWin32Screen.Done;
  701. begin
  702. { copy the Dos buffer content into the original ScreenBuffer
  703. which remains the startup std_output_handle PM }
  704. {if StartScreenBufferHandle=IDEScreenBufferHandle then}
  705. BufferCopy(DosScreenBufferHandle,IDEScreenBufferHandle);
  706. SetConsoleActiveScreenBuffer(StartScreenBufferHandle);
  707. SetStdHandle(Std_Output_Handle,StartScreenBufferHandle);
  708. UpdateFileHandles;
  709. CloseHandle(NewScreenBufferHandle);
  710. CloseHandle(DummyScreenBufferHandle);
  711. inherited Done;
  712. end;
  713. function TWin32Screen.GetWidth: integer;
  714. var
  715. ConsoleScreenBufferInfo : Console_screen_buffer_info;
  716. begin
  717. GetConsoleScreenBufferInfo(DosScreenBufferHandle,
  718. @ConsoleScreenBufferInfo);
  719. GetWidth:=ConsoleScreenBufferInfo.dwSize.X;
  720. end;
  721. function TWin32Screen.GetHeight: integer;
  722. var
  723. ConsoleScreenBufferInfo : Console_screen_buffer_info;
  724. begin
  725. GetConsoleScreenBufferInfo(DosScreenBufferHandle,
  726. @ConsoleScreenBufferInfo);
  727. GetHeight:=ConsoleScreenBufferInfo.dwSize.Y;
  728. end;
  729. function TWin32Screen.Scroll(i : integer) : integer;
  730. var
  731. ConsoleScreenBufferInfo : Console_screen_buffer_info;
  732. ConsoleWindow : Small_rect;
  733. begin
  734. GetConsoleScreenBufferInfo(DosScreenBufferHandle,
  735. @ConsoleScreenBufferInfo);
  736. if (ConsoleScreenBufferInfo.srWindow.Top + i < 0) then
  737. i:= -ConsoleScreenBufferInfo.srWindow.Top;
  738. if (ConsoleScreenBufferInfo.srWindow.Bottom + i > ConsoleScreenBufferInfo.dwSize.Y) then
  739. i:= ConsoleScreenBufferInfo.dwSize.Y - ConsoleScreenBufferInfo.srWindow.Bottom;
  740. if i<>0 then
  741. begin
  742. ConsoleWindow.Left:=ConsoleScreenBufferInfo.srWindow.Left;
  743. ConsoleWindow.Right:=ConsoleScreenBufferInfo.srWindow.Right;
  744. ConsoleWindow.Top:=ConsoleScreenBufferInfo.srWindow.Top+i;
  745. ConsoleWindow.Bottom:=ConsoleScreenBufferInfo.srWindow.Bottom+i;
  746. SetConsoleWindowInfo(DosScreenBufferHandle,true,ConsoleWindow);
  747. Scroll:=i;
  748. end
  749. else
  750. Scroll:=0;
  751. end;
  752. procedure TWin32Screen.GetLine(Line: integer; var Text, Attr: string);
  753. type
  754. CharInfoArray = Array [0..255] of Char_Info;
  755. var
  756. LineBuf : ^CharInfoArray;
  757. BufSize,BufCoord : Coord;
  758. i,LineSize : longint;
  759. WriteRegion : SMALL_RECT;
  760. begin
  761. GetMem(LineBuf,SizeOf(CharInfoArray));
  762. LineSize:=ScreenWidth;
  763. If LineSize>256 then
  764. LineSize:=256;
  765. BufSize.X:=LineSize;
  766. BufSize.Y:=1;
  767. BufCoord.X:=0;
  768. BufCoord.Y:=0;
  769. with WriteRegion do
  770. begin
  771. Top :=Line;
  772. Left :=0;
  773. Bottom := Line+1;
  774. Right := LineSize-1;
  775. end;
  776. ReadConsoleOutput(DosScreenBufferHandle, PChar_info(LineBuf),
  777. BufSize, BufCoord, @WriteRegion);
  778. for i:=1 to LineSize do
  779. begin
  780. Text[i]:=LineBuf^[i-1].AsciiChar;
  781. Attr[i]:=char(byte(LineBuf^[i-1].Attributes));
  782. end;
  783. FreeMem(LineBuf,SizeOf(CharInfoArray));
  784. Text[0]:=char(byte(LineSize));
  785. Attr[0]:=char(byte(LineSize));
  786. end;
  787. procedure TWin32Screen.GetCursorPos(var P: TPoint);
  788. var
  789. ConsoleScreenBufferInfo : Console_screen_buffer_info;
  790. begin
  791. GetConsoleScreenBufferInfo(DosScreenBufferHandle,
  792. @ConsoleScreenBufferInfo);
  793. P.X:=ConsoleScreenBufferInfo.dwCursorPosition.X;
  794. P.Y:=ConsoleScreenBufferInfo.dwCursorPosition.Y;
  795. end;
  796. procedure TWin32Screen.BufferCopy(Src, Dest : THandle);
  797. type
  798. CharInfoArray = Array [0..256*255-1] of Char_Info;
  799. var
  800. LineBuf : ^CharInfoArray;
  801. BufSize,BufCoord : Coord;
  802. Error, LineSize,
  803. Part, OnePartY: longint;
  804. res : boolean;
  805. WriteRegion : SMALL_RECT;
  806. ConsoleScreenBufferInfo : Console_screen_buffer_info;
  807. DestConsoleScreenBufferInfo : Console_screen_buffer_info;
  808. begin
  809. GetConsoleScreenBufferInfo(Src,
  810. @ConsoleScreenBufferInfo);
  811. GetConsoleScreenBufferInfo(Dest,
  812. @DestConsoleScreenBufferInfo);
  813. GetMem(LineBuf,SizeOf(CharInfoArray));
  814. FillChar(LineBuf^,SizeOf(CharInfoArray),#0);
  815. LineSize:=ConsoleScreenBufferInfo.dwSize.X;
  816. If LineSize>256 then
  817. LineSize:=256;
  818. BufSize.X:=LineSize;
  819. BufSize.Y:=ConsoleScreenBufferInfo.dwSize.Y;
  820. BufCoord.X:=0;
  821. BufCoord.Y:=0;
  822. with WriteRegion do
  823. begin
  824. Top :=0;
  825. Left :=0;
  826. Bottom := ConsoleScreenBufferInfo.dwSize.Y-1;
  827. Right := LineSize-1;
  828. end;
  829. if BufSize.X*BufSize.Y*Sizeof(CHAR_INFO) >= $8000 then
  830. begin
  831. OnePartY := ($8000 -1) div (BufSize.X * SizeOf(Char_Info) );
  832. BufSize.Y:=OnePartY;
  833. Part:=0;
  834. while ((Part+1)*OnePartY < ConsoleScreenBufferInfo.dwSize.Y) do
  835. begin
  836. WriteRegion.Top := Part*OnePartY;
  837. WriteRegion.Bottom := (Part+1)*OnePartY-1;
  838. res:=ReadConsoleOutput(Src, PChar_info(LineBuf),
  839. BufSize, BufCoord, @WriteRegion);
  840. if not res then
  841. Error:=GetLastError;
  842. res:=WriteConsoleOutput(Dest, PChar_info(LineBuf),
  843. BufSize, BufCoord, @WriteRegion);
  844. if not res then
  845. Error:=GetLastError;
  846. Inc(Part);
  847. end;
  848. BufSize.Y:=ConsoleScreenBufferInfo.dwSize.Y - Part*OnePartY;
  849. WriteRegion.Top := Part*OnePartY;
  850. WriteRegion.Bottom := ConsoleScreenBufferInfo.dwSize.Y-1;
  851. res:=ReadConsoleOutput(Src, PChar_info(LineBuf),
  852. BufSize, BufCoord, @WriteRegion);
  853. if not res then
  854. Error:=GetLastError;
  855. res:=WriteConsoleOutput(Dest, PChar_info(LineBuf),
  856. BufSize, BufCoord, @WriteRegion);
  857. if not res then
  858. Error:=GetLastError;
  859. end
  860. else
  861. begin
  862. res:=ReadConsoleOutput(Src, PChar_info(LineBuf),
  863. BufSize, BufCoord, @WriteRegion);
  864. if not res then
  865. Error:=GetLastError;
  866. res:=WriteConsoleOutput(Dest, PChar_info(LineBuf),
  867. BufSize, BufCoord, @WriteRegion);
  868. if not res then
  869. Error:=GetLastError;
  870. end;
  871. FreeMem(LineBuf,SizeOf(CharInfoArray));
  872. SetConsoleCursorPosition(Dest, ConsoleScreenBufferInfo.dwCursorPosition);
  873. end;
  874. procedure TWin32Screen.Capture;
  875. begin
  876. {if StartScreenBufferHandle=IdeScreenBufferHandle then
  877. BufferCopy(IDEScreenBufferHandle,DosScreenBufferHandle)
  878. else
  879. BufferCopy(DosScreenBufferHandle,IDEScreenBufferHandle);}
  880. SaveConsoleScreen;
  881. end;
  882. { dummy for win32 as the Buffer screen
  883. do hold all the info }
  884. procedure TWin32Screen.SaveIDEScreen;
  885. begin
  886. {$ifdef fvision}
  887. if TextModeGFV then
  888. {$endif fvision}
  889. begin
  890. IdeScreenMode:=ScreenMode;
  891. GetConsoleMode(GetStdHandle(Std_Input_Handle), @IdeMode);
  892. { set the dummy buffer as active already now PM }
  893. SetStdHandle(Std_Output_Handle,DummyScreenBufferHandle);
  894. UpdateFileHandles;
  895. end;
  896. end;
  897. { dummy for win32 as the Buffer screen
  898. do hold all the info }
  899. procedure TWin32Screen.SaveConsoleScreen;
  900. begin
  901. {$ifdef fvision}
  902. if TextModeGFV then
  903. {$endif fvision}
  904. begin
  905. GetConsoleMode(GetStdHandle(Std_Input_Handle), @ConsoleMode);
  906. { set the dummy buffer as active already now PM }
  907. SetStdHandle(Std_Output_Handle,DummyScreenBufferHandle);
  908. UpdateFileHandles;
  909. end;
  910. end;
  911. procedure TWin32Screen.SwitchToConsoleScreen;
  912. begin
  913. {$ifdef fvision}
  914. if TextModeGFV then
  915. {$endif fvision}
  916. begin
  917. SetConsoleActiveScreenBuffer(DosScreenBufferHandle);
  918. SetStdHandle(Std_Output_Handle,DosScreenBufferHandle);
  919. SetConsoleMode(GetStdHandle(Std_Input_Handle), ConsoleMode);
  920. UpdateFileHandles;
  921. end;
  922. IDEActive:=false;
  923. end;
  924. procedure TWin32Screen.SwitchBackToIDEScreen;
  925. var
  926. ConsoleScreenBufferInfo : Console_screen_buffer_info;
  927. WindowPos : Small_rect;
  928. res : boolean;
  929. error : longint;
  930. begin
  931. {$ifdef fvision}
  932. if TextModeGFV then
  933. {$endif fvision}
  934. begin
  935. SetStdHandle(Std_Output_Handle,IDEScreenBufferHandle);
  936. UpdateFileHandles;
  937. GetConsoleScreenBufferInfo(IDEScreenBufferHandle,
  938. @ConsoleScreenBufferInfo);
  939. SetConsoleActiveScreenBuffer(IDEScreenBufferHandle);
  940. {$ifdef fvision}
  941. { Needed to force InitSystemMsg to use the right console handle }
  942. DoneEvents;
  943. InitEvents;
  944. {$endif fvision}
  945. IdeMode:=(IdeMode or ENABLE_MOUSE_INPUT or ENABLE_WINDOW_INPUT) and not ENABLE_PROCESSED_INPUT;
  946. SetConsoleMode(GetStdHandle(Std_Input_Handle), IdeMode);
  947. WindowPos.left:=0;
  948. WindowPos.right:=ConsoleScreenBufferInfo.srWindow.right
  949. -ConsoleScreenBufferInfo.srWindow.left;
  950. WindowPos.top:=0;
  951. WindowPos.bottom:=ConsoleScreenBufferInfo.srWindow.bottom
  952. -ConsoleScreenBufferInfo.srWindow.top;
  953. with ConsoleScreenBufferInfo.dwMaximumWindowSize do
  954. begin
  955. if WindowPos.Right<X-1 then
  956. WindowPos.right:=X-1;
  957. if WindowPos.Bottom<Y-1 then
  958. WindowPos.Bottom:=Y-1;
  959. end;
  960. res:=SetConsoleWindowInfo(IDEScreenBufferHandle,true,WindowPos);
  961. if not res then
  962. error:=GetLastError;
  963. {$ifdef DEBUG}
  964. IdeScreenMode.row:=WindowPos.bottom+1;
  965. IdeScreenMode.col:=WindowPos.right+1;
  966. {$endif DEBUG}
  967. { needed to force the correct size for videobuf }
  968. if Assigned(Application) and (IdeScreenMode.row<>0)then
  969. Application^.SetScreenVideoMode(IdeScreenMode);
  970. end;
  971. IDEActive:=true;
  972. end;
  973. {$endif}
  974. {****************************************************************************
  975. Initialize
  976. ****************************************************************************}
  977. procedure InitUserScreen;
  978. begin
  979. {$ifdef DOS}
  980. UserScreen:=New(PDOSScreen, Init);
  981. {$else}
  982. {$ifdef Unix}
  983. UserScreen:=New(PLinuxScreen, Init);
  984. {$else}
  985. {$ifdef Win32}
  986. UserScreen:=New(PWin32Screen, Init);
  987. {$else}
  988. UserScreen:=New(PScreen, Init);
  989. {$endif Win32}
  990. {$endif Unix}
  991. {$endif Dos}
  992. end;
  993. procedure DoneUserScreen;
  994. begin
  995. if UserScreen<>nil then
  996. begin
  997. UserScreen^.SwitchToConsoleScreen;
  998. Dispose(UserScreen, Done);
  999. UserScreen:=nil;
  1000. end;
  1001. end;
  1002. end.
  1003. {
  1004. $Log$
  1005. Revision 1.16 2002-09-04 08:35:31 pierre
  1006. * remember IDE screen mode for win32
  1007. to avoid videobuf writes after allocated size.
  1008. Revision 1.15 2002/09/03 05:45:39 pierre
  1009. * fix compilation without DEBUG conditional
  1010. Revision 1.14 2002/09/02 09:29:55 pierre
  1011. + new test code for go32v2 graphic screen saves (only with -dDEBUG)
  1012. Revision 1.13 2002/06/13 11:18:32 pierre
  1013. + xterm window switching support
  1014. Revision 1.12 2002/06/07 14:10:24 pierre
  1015. * try to get resizing to work
  1016. Revision 1.11 2002/06/06 14:10:34 pierre
  1017. * allow window input for fvsion system messages
  1018. Revision 1.10 2002/06/06 06:46:28 pierre
  1019. * No videobuffer switch necessary for fvision win32 graphic version
  1020. Revision 1.9 2002/04/25 13:34:17 pierre
  1021. * fix the disappearing desktop for win32
  1022. Revision 1.8 2002/01/22 16:29:52 pierre
  1023. * try to fix win32 problem with Dos program ouptut in command shell
  1024. Warning, to debug under win32 with GDB you must use "set new-console on"
  1025. Revision 1.7 2001/11/08 17:06:22 pierre
  1026. * impose the correct size for win32 console window
  1027. Revision 1.6 2001/11/08 16:38:25 pierre
  1028. * fix win32 scrolling
  1029. + always go back to 0,0 position in IDE mode
  1030. Revision 1.5 2001/11/08 16:07:41 pierre
  1031. * overcome buffer win32 problem due to a bug in ReadConsoleOutput
  1032. Revision 1.4 2001/10/24 14:17:27 pierre
  1033. * try to fix the Win2000 mouse problem
  1034. Revision 1.3 2001/09/09 20:44:53 carl
  1035. * bugfix of console sharing mode (on NT this would bug all
  1036. std_input access).
  1037. Revision 1.2 2001/08/12 00:04:50 pierre
  1038. * some speed improvements for string operations
  1039. Revision 1.1 2001/08/04 11:30:24 peter
  1040. * ide works now with both compiler versions
  1041. Revision 1.1.2.10 2001/06/14 09:15:16 pierre
  1042. TScreen methods reorganized:
  1043. SwitchTo method renamed SwitchToConsoleScreen
  1044. SwitchBack method renamed SwitchBackToIDEScreen
  1045. + method Scroll added
  1046. + SaveIDEScreen and SaveConsoleScreen methods added
  1047. Revision 1.1.2.9 2001/04/04 08:52:01 pierre
  1048. * allow inheritance for win32 DosScreenBufferHandle
  1049. Revision 1.1.2.8 2001/03/16 17:45:54 pierre
  1050. * free VIDEBuffer of TDosScreen
  1051. Revision 1.1.2.7 2000/11/30 13:04:01 pierre
  1052. * fix for bug 1205
  1053. Revision 1.1.2.6 2000/11/29 00:54:45 pierre
  1054. + preserve window number and save special windows
  1055. Revision 1.1.2.5 2000/11/22 12:47:21 pierre
  1056. * fix the screen saving at start for win32
  1057. Revision 1.1.2.4 2000/11/14 09:23:56 marco
  1058. * Second batch
  1059. Revision 1.1.2.3 2000/10/10 21:24:56 pierre
  1060. * avoid writing past IDE_screen buffer length
  1061. Revision 1.1.2.2 2000/08/21 12:10:19 jonas
  1062. * fixed errors in my previous commit, it now works properly
  1063. Revision 1.1.2.1 2000/08/21 10:51:13 jonas
  1064. * IDE screen saving/restoring implemented for Linux
  1065. Revision 1.1 2000/07/13 09:48:36 michael
  1066. + Initial import
  1067. Revision 1.13 2000/06/16 15:00:20 pierre
  1068. * accord to new WriteConsoleOuput declarations
  1069. Revision 1.12 2000/04/25 08:42:33 pierre
  1070. * New Gabor changes : see fixes.txt
  1071. Revision 1.11 2000/04/18 11:42:37 pierre
  1072. lot of Gabor changes : see fixes.txt
  1073. Revision 1.10 2000/03/13 20:30:37 pierre
  1074. + stores IDE screen before Switching for DOS
  1075. Revision 1.9 2000/02/04 23:17:25 pierre
  1076. * Keep the entry ScreenBuffer at exit
  1077. Revision 1.8 1999/12/01 16:17:18 pierre
  1078. * Restore std_output_handle correctly at exit for GDB
  1079. Revision 1.7 1999/11/10 17:12:00 pierre
  1080. * Win32 screen problems solved
  1081. Revision 1.6 1999/09/22 13:02:00 pierre
  1082. + Twin32Screen added
  1083. Revision 1.5 1999/08/16 18:25:24 peter
  1084. * Adjusting the selection when the editor didn't contain any line.
  1085. * Reserved word recognition redesigned, but this didn't affect the overall
  1086. syntax highlight speed remarkably (at least not on my Amd-K6/350).
  1087. The syntax scanner loop is a bit slow but the main problem is the
  1088. recognition of special symbols. Switching off symbol processing boosts
  1089. the performance up to ca. 200%...
  1090. * The editor didn't allow copying (for ex to clipboard) of a single character
  1091. * 'File|Save as' caused permanently run-time error 3. Not any more now...
  1092. * Compiler Messages window (actually the whole desktop) did not act on any
  1093. keypress when compilation failed and thus the window remained visible
  1094. + Message windows are now closed upon pressing Esc
  1095. + At 'Run' the IDE checks whether any sources are modified, and recompiles
  1096. only when neccessary
  1097. + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
  1098. + LineSelect (Ctrl+K+L) implemented
  1099. * The IDE had problems closing help windows before saving the desktop
  1100. Revision 1.4 1999/06/28 19:32:25 peter
  1101. * fixes from gabor
  1102. Revision 1.3 1999/02/02 16:41:42 peter
  1103. + automatic .pas/.pp adding by opening of file
  1104. * better debuggerscreen changes
  1105. Revision 1.2 1999/01/04 11:49:51 peter
  1106. * 'Use tab characters' now works correctly
  1107. + Syntax highlight now acts on File|Save As...
  1108. + Added a new class to syntax highlight: 'hex numbers'.
  1109. * There was something very wrong with the palette managment. Now fixed.
  1110. + Added output directory (-FE<xxx>) support to 'Directories' dialog...
  1111. * Fixed some possible bugs in Running/Compiling, and the compilation/run
  1112. process revised
  1113. Revision 1.1 1998/12/28 15:47:53 peter
  1114. + Added user screen support, display & window
  1115. + Implemented Editor,Mouse Options dialog
  1116. + Added location of .INI and .CFG file
  1117. + Option (INI) file managment implemented (see bottom of Options Menu)
  1118. + Switches updated
  1119. + Run program
  1120. Revision 1.0 1998/12/24 09:55:49 gabor
  1121. Original implementation
  1122. }