fpcompil.pas 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Compiler call routines for the IDE
  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 FPCompil;
  14. interface
  15. { don't redir under linux, because all stdout (also from the ide!) will
  16. then be redired (PFV) }
  17. { this should work now correctly because
  18. RedirDisableAll and RedirEnableAll function are added in fpredir (PM) }
  19. { $define VERBOSETXT}
  20. uses
  21. Objects,
  22. finput,
  23. Drivers,Views,Dialogs,
  24. WViews,WCEdit,
  25. FPSymbol,
  26. FPViews;
  27. type
  28. TCompileMode = (cBuild,cMake,cCompile,cRun);
  29. type
  30. PCompilerMessage = ^TCompilerMessage;
  31. TCompilerMessage = object(TMessageItem)
  32. function GetText(MaxLen: Sw_Integer): String; virtual;
  33. end;
  34. PCompilerMessageListBox = ^TCompilerMessageListBox;
  35. TCompilerMessageListBox = object(TMessageListBox)
  36. function GetPalette: PPalette; virtual;
  37. procedure SelectFirstError;
  38. end;
  39. PCompilerMessageWindow = ^TCompilerMessageWindow;
  40. TCompilerMessageWindow = object(TFPWindow)
  41. constructor Init;
  42. procedure HandleEvent(var Event: TEvent); virtual;
  43. function GetPalette: PPalette; virtual;
  44. procedure Close;virtual;
  45. destructor Done; virtual;
  46. procedure SizeLimits(var Min, Max: TPoint); virtual;
  47. procedure AddMessage(AClass: longint;const Msg, Module: string; Line, Column: longint);
  48. procedure ClearMessages;
  49. constructor Load(var S: TStream);
  50. procedure Store(var S: TStream);
  51. procedure SetState(AState: Word; Enable: Boolean); virtual;
  52. procedure UpdateCommands; virtual;
  53. private
  54. {CompileShowed : boolean;}
  55. {Mode : TCompileMode;}
  56. MsgLB : PCompilerMessageListBox;
  57. {CurrST,
  58. InfoST : PColorStaticText;}
  59. end;
  60. PCompilerStatusDialog = ^TCompilerStatusDialog;
  61. TCompilerStatusDialog = object(TCenterDialog)
  62. ST : PAdvancedStaticText;
  63. KeyST : PColorStaticText;
  64. constructor Init;
  65. procedure Update;
  66. end;
  67. PFPInputFile = ^TFPInputFile;
  68. TFPInputFile = object(tinputfile)
  69. constructor Init(AEditor: PFileEditor);
  70. {$ifdef FPC}protected{$else}public{$endif}
  71. function fileopen(const filename: string): boolean; virtual;
  72. function fileseek(pos: longint): boolean; virtual;
  73. function fileread(var databuf; maxsize: longint): longint; virtual;
  74. function fileeof: boolean; virtual;
  75. function fileclose: boolean; virtual;
  76. private
  77. Editor: PFileEditor;
  78. S: PStream;
  79. end;
  80. const
  81. CompilerMessageWindow : PCompilerMessageWindow = nil;
  82. CompilerStatusDialog : PCompilerStatusDialog = nil;
  83. procedure DoCompile(Mode: TCompileMode);
  84. function NeedRecompile(verbose : boolean): boolean;
  85. procedure ParseUserScreen;
  86. procedure RegisterFPCompile;
  87. implementation
  88. uses
  89. {$ifdef linux}
  90. Linux,
  91. {$endif}
  92. Dos,Video,
  93. App,Commands,tokens,
  94. Globals, CompHook, Compiler, systems, browcol,
  95. WUtils,WEditor,
  96. FPString,FPRedir,FPDesk,FPUsrScr,FPHelp,
  97. FPConst,FPVars,FPUtils,FPIntf,FPSwitch;
  98. {$ifndef NOOBJREG}
  99. const
  100. RCompilerMessageListBox: TStreamRec = (
  101. ObjType: 1211;
  102. VmtLink: Ofs(TypeOf(TCompilerMessageListBox)^);
  103. Load: @TCompilerMessageListBox.Load;
  104. Store: @TCompilerMessageListBox.Store
  105. );
  106. RCompilerMessageWindow: TStreamRec = (
  107. ObjType: 1212;
  108. VmtLink: Ofs(TypeOf(TCompilerMessageWindow)^);
  109. Load: @TCompilerMessageWindow.Load;
  110. Store: @TCompilerMessageWindow.Store
  111. );
  112. {$endif}
  113. procedure ParseUserScreen;
  114. var
  115. y : longint;
  116. Text,Attr : String;
  117. DisplayCompilerWindow : boolean;
  118. cc: integer;
  119. procedure SearchBackTrace;
  120. var AText,ModuleName,st : String;
  121. row : longint;
  122. begin
  123. if pos(' 0x',Text)=1 then
  124. begin
  125. AText:=Text;
  126. Delete(Text,1,10);
  127. While pos(' ',Text)=1 do
  128. Delete(Text,1,1);
  129. if pos('of ',Text)>0 then
  130. begin
  131. ModuleName:=Copy(Text,pos('of ',Text)+3,255);
  132. While ModuleName[Length(ModuleName)]=' ' do
  133. Delete(ModuleName,Length(ModuleName),1);
  134. end
  135. else
  136. ModuleName:='';
  137. if pos('line ',Text)>0 then
  138. begin
  139. Text:=Copy(Text,Pos('line ',Text)+5,255);
  140. st:=Copy(Text,1,Pos(' ',Text)-1);
  141. Val(st,row,cc);
  142. end
  143. else
  144. row:=0;
  145. CompilerMessageWindow^.AddMessage(V_Fatal,AText
  146. ,ModuleName,row,1);
  147. DisplayCompilerWindow:=true;
  148. end;
  149. end;
  150. procedure InsertInMessages(Const TypeStr : String;_Type : longint;EnableDisplay : boolean);
  151. var p,p2,col,row : longint;
  152. St,ModuleName : string;
  153. begin
  154. p:=pos(TypeStr,Text);
  155. p2:=Pos('(',Text);
  156. if (p>0) and (p2>0) and (p2<p) then
  157. begin
  158. ModuleName:=Copy(Text,1,p2-1);
  159. st:=Copy(Text,p2+1,255);
  160. Val(Copy(st,1,pos(',',st)-1),row,cc);
  161. st:=Copy(st,Pos(',',st)+1,255);
  162. Val(Copy(st,1,pos(')',st)-1),col,cc);
  163. CompilerMessageWindow^.AddMessage(_type,Copy(Text,pos(':',Text)+1,255)
  164. ,ModuleName,row,col);
  165. If EnableDisplay then
  166. DisplayCompilerWindow:=true;
  167. end;
  168. end;
  169. begin
  170. if not assigned(UserScreen) then
  171. exit;
  172. DisplayCompilerWindow:=false;
  173. PushStatus('Parsing User Screen');
  174. for Y:=0 to UserScreen^.GetHeight do
  175. begin
  176. UserScreen^.GetLine(Y,Text,Attr);
  177. SearchBackTrace;
  178. InsertInMessages(' Fatal:',v_Fatal,true);
  179. InsertInMessages(' Error:',v_Error,true);
  180. InsertInMessages(' Warning:',v_Warning,false);
  181. InsertInMessages(' Note:',v_Note,false);
  182. InsertInMessages(' Info:',v_Info,false);
  183. InsertInMessages(' Hint:',v_Hint,false);
  184. end;
  185. if DisplayCompilerWindow then
  186. begin
  187. if not CompilerMessageWindow^.GetState(sfVisible) then
  188. CompilerMessageWindow^.Show;
  189. CompilerMessageWindow^.MakeFirst;
  190. CompilerMessageWindow^.MsgLB^.SelectFirstError;
  191. end;
  192. PopStatus;
  193. end;
  194. {*****************************************************************************
  195. TCompilerMessage
  196. *****************************************************************************}
  197. function TCompilerMessage.GetText(MaxLen: Sw_Integer): String;
  198. var
  199. ClassS: string[20];
  200. S: string;
  201. begin
  202. if TClass=
  203. V_Fatal then ClassS:=msg_class_Fatal else if TClass =
  204. V_Error then ClassS:=msg_class_Error else if TClass =
  205. V_Normal then ClassS:=msg_class_Normal else if TClass =
  206. V_Warning then ClassS:=msg_class_Warning else if TClass =
  207. V_Note then ClassS:=msg_class_Note else if TClass =
  208. V_Hint then ClassS:=msg_class_Hint
  209. {$ifdef VERBOSETXT}
  210. else if TClass =
  211. V_Macro then ClassS:=msg_class_macro else if TClass =
  212. V_Procedure then ClassS:=msg_class_procedure else if TClass =
  213. V_Conditional then ClassS:=msg_class_conditional else if TClass =
  214. V_Info then ClassS:=msg_class_info else if TClass =
  215. V_Status then ClassS:=msg_class_status else if TClass =
  216. V_Used then ClassS:=msg_class_used else if TClass =
  217. V_Tried then ClassS:=msg_class_tried else if TClass =
  218. V_Debug then ClassS:=msg_class_debug
  219. else
  220. ClassS:='???';
  221. {$else}
  222. else
  223. ClassS:='';
  224. {$endif}
  225. if ClassS<>'' then
  226. ClassS:=RExpand(ClassS,0)+': ';
  227. if assigned(Module) and
  228. (TClass<=V_ShowFile)
  229. {and (status.currentsource<>'') and (status.currentline>0)} then
  230. begin
  231. if Row>0 then
  232. begin
  233. if Col>0 then
  234. S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+','+IntToStr(Col)+') '+ClassS
  235. else
  236. S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+') '+ClassS;
  237. end
  238. else
  239. S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+') '+ClassS
  240. end
  241. else
  242. S:=ClassS;
  243. if assigned(Text) then
  244. S:=S+Text^;
  245. if length(S)>MaxLen then
  246. S:=copy(S,1,MaxLen-2)+'..';
  247. GetText:=S;
  248. end;
  249. {*****************************************************************************
  250. TCompilerMessageListBox
  251. *****************************************************************************}
  252. function TCompilerMessageListBox.GetPalette: PPalette;
  253. const
  254. P: string[length(CBrowserListBox)] = CBrowserListBox;
  255. begin
  256. GetPalette:=@P;
  257. end;
  258. procedure TCompilerMessageListBox.SelectFirstError;
  259. function IsError(P : PCompilerMessage) : boolean;
  260. begin
  261. IsError:=(P^.TClass and (V_Fatal or V_Error))<>0;
  262. end;
  263. var
  264. P : PCompilerMessage;
  265. begin
  266. P:=List^.FirstThat(@IsError);
  267. If Assigned(P) then
  268. Begin
  269. FocusItem(List^.IndexOf(P));
  270. DrawView;
  271. End;
  272. end;
  273. {*****************************************************************************
  274. TCompilerMessageWindow
  275. *****************************************************************************}
  276. constructor TCompilerMessageWindow.Init;
  277. var R: TRect;
  278. HSB,VSB: PScrollBar;
  279. begin
  280. Desktop^.GetExtent(R);
  281. R.A.Y:=R.B.Y-7;
  282. inherited Init(R,dialog_compilermessages,{SearchFreeWindowNo}wnNoNumber);
  283. HelpCtx:=hcMessagesWindow;
  284. AutoNumber:=true;
  285. HSB:=StandardScrollBar(sbHorizontal+sbHandleKeyboard);
  286. HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
  287. Insert(HSB);
  288. VSB:=StandardScrollBar(sbVertical+sbHandleKeyboard);
  289. VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY;
  290. Insert(VSB);
  291. GetExtent(R);
  292. R.Grow(-1,-1);
  293. New(MsgLB, Init(R, HSB, VSB));
  294. MsgLB^.GrowMode:=gfGrowHiX+gfGrowHiY;
  295. Insert(MsgLB);
  296. CompilerMessageWindow:=@self;
  297. end;
  298. procedure TCompilerMessageWindow.AddMessage(AClass: longint;const Msg, Module: string; Line, Column: longint);
  299. begin
  300. if AClass>=V_Info then
  301. Line:=0;
  302. MsgLB^.AddItem(New(PCompilerMessage,Init(AClass, Msg, MsgLB^.AddModuleName(Module), Line, Column)));
  303. end;
  304. procedure TCompilerMessageWindow.ClearMessages;
  305. begin
  306. MsgLB^.Clear;
  307. ReDraw;
  308. end;
  309. {procedure TCompilerMessageWindow.Updateinfo;
  310. begin
  311. if CompileShowed then
  312. begin
  313. InfoST^.SetText(
  314. RExpand(' Main file : '#1#$7f+Copy(SmartPath(MainFile),1,39),40)+#2+
  315. 'Total lines : '#1#$7e+IntToStr(Status.CompiledLines)+#2#13+
  316. RExpand(' Target : '#1#$7f+KillTilde(TargetSwitches^.ItemName(TargetSwitches^.GetCurrSel)),40)+#2+
  317. 'Total errors : '#1#$7e+IntToStr(Status.ErrorCount)
  318. );
  319. if status.currentline>0 then
  320. CurrST^.SetText(' Status: '#1#$7e+status.currentsource+'('+IntToStr(status.currentline)+')'#2)
  321. else
  322. CurrST^.SetText(' Status: '#1#$7e+status.currentsource+#2);
  323. end;
  324. ReDraw;
  325. end;}
  326. procedure TCompilerMessageWindow.HandleEvent(var Event: TEvent);
  327. begin
  328. case Event.What of
  329. evBroadcast :
  330. case Event.Command of
  331. cmListFocusChanged :
  332. if Event.InfoPtr=MsgLB then
  333. Message(Application,evBroadcast,cmClearLineHighlights,@Self);
  334. end;
  335. end;
  336. inherited HandleEvent(Event);
  337. end;
  338. procedure TCompilerMessageWindow.SizeLimits(var Min, Max: TPoint);
  339. begin
  340. inherited SizeLimits(Min,Max);
  341. Min.X:=20;
  342. Min.Y:=4;
  343. end;
  344. procedure TCompilerMessageWindow.Close;
  345. begin
  346. Hide;
  347. end;
  348. function TCompilerMessageWindow.GetPalette: PPalette;
  349. const
  350. S : string[length(CBrowserWindow)] = CBrowserWindow;
  351. begin
  352. GetPalette:=@S;
  353. end;
  354. constructor TCompilerMessageWindow.Load(var S: TStream);
  355. begin
  356. inherited Load(S);
  357. GetSubViewPtr(S,MsgLB);
  358. end;
  359. procedure TCompilerMessageWindow.Store(var S: TStream);
  360. begin
  361. if MsgLB^.List=nil then
  362. MsgLB^.NewList(New(PCollection, Init(100,100)));
  363. inherited Store(S);
  364. PutSubViewPtr(S,MsgLB);
  365. end;
  366. procedure TCompilerMessageWindow.UpdateCommands;
  367. var Active: boolean;
  368. begin
  369. Active:=GetState(sfActive);
  370. SetCmdState(CompileCmds,Active);
  371. Message(Application,evBroadcast,cmCommandSetChanged,nil);
  372. end;
  373. procedure TCompilerMessageWindow.SetState(AState: Word; Enable: Boolean);
  374. var OldState: word;
  375. begin
  376. OldState:=State;
  377. inherited SetState(AState,Enable);
  378. if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
  379. UpdateCommands;
  380. end;
  381. destructor TCompilerMessageWindow.Done;
  382. begin
  383. CompilerMessageWindow:=nil;
  384. inherited Done;
  385. end;
  386. {****************************************************************************
  387. CompilerStatusDialog
  388. ****************************************************************************}
  389. constructor TCompilerStatusDialog.Init;
  390. var R: TRect;
  391. begin
  392. R.Assign(0,0,50,11);
  393. ClearFormatParams; AddFormatParamStr(KillTilde(SwitchesModeName[SwitchesMode]));
  394. inherited Init(R, FormatStrF(dialog_compilingwithmode, FormatParams));
  395. GetExtent(R); R.B.Y:=11;
  396. R.Grow(-3,-2);
  397. New(ST, Init(R, ''));
  398. Insert(ST);
  399. GetExtent(R); R.B.Y:=11;
  400. R.Grow(-1,-1); R.A.Y:=R.B.Y-1;
  401. New(KeyST, Init(R, '', Blue*16+White+longint($80+Blue*16+White)*256,true));
  402. Insert(KeyST);
  403. end;
  404. procedure TCompilerStatusDialog.Update;
  405. var
  406. StatusS,KeyS: string;
  407. begin
  408. {$ifdef TEMPHEAP}
  409. switch_to_base_heap;
  410. {$endif TEMPHEAP}
  411. case CompilationPhase of
  412. cpCompiling :
  413. begin
  414. ClearFormatParams; AddFormatParamStr(SmartPath(Status.CurrentSource));
  415. StatusS:=FormatStrF(msg_compilingfile,FormatParams);
  416. KeyS:=msg_hint_pressesctocancel;
  417. end;
  418. cpLinking :
  419. begin
  420. ClearFormatParams; AddFormatParamStr(ExeFile);
  421. StatusS:=FormatStrF(msg_linkingfile,FormatParams);
  422. KeyS:=msg_hint_pleasewait;
  423. end;
  424. cpDone :
  425. begin
  426. StatusS:=msg_compiledone;
  427. KeyS:=msg_hint_compilesuccessfulpressenter;
  428. end;
  429. cpFailed :
  430. begin
  431. StatusS:=msg_failedtocompile;
  432. KeyS:=msg_hint_compilefailed;
  433. end;
  434. cpAborted :
  435. begin
  436. StatusS:=msg_compilationaborted;
  437. KeyS:=msg_hint_compileaborted;
  438. end;
  439. end;
  440. ClearFormatParams;
  441. AddFormatParamStr(SmartPath(MainFile));
  442. AddFormatParamStr(StatusS);
  443. AddFormatParamStr(KillTilde(TargetSwitches^.ItemName(TargetSwitches^.GetCurrSel)));
  444. AddFormatParamInt(Status.CurrentLine);
  445. AddFormatParamInt(MemAvail div 1024);
  446. AddFormatParamInt(Status.CompiledLines);
  447. AddFormatParamInt(Status.ErrorCount);
  448. ST^.SetText(
  449. FormatStrF(
  450. 'Main file: %s'#13+
  451. '%s'+#13#13+
  452. 'Target: %12s '+ 'Line number: %7d'+#13+
  453. 'Free memory: %6dK '+'Total lines: %7d'+#13+
  454. 'Total errors: %5d',
  455. FormatParams)
  456. );
  457. KeyST^.SetText(^C+KeyS);
  458. {$ifdef TEMPHEAP}
  459. switch_to_temp_heap;
  460. {$endif TEMPHEAP}
  461. end;
  462. {****************************************************************************
  463. Compiler Hooks
  464. ****************************************************************************}
  465. function CompilerStatus: boolean; {$ifndef FPC}far;{$endif}
  466. var
  467. event : tevent;
  468. begin
  469. GetKeyEvent(Event);
  470. if (Event.What=evKeyDown) and (Event.KeyCode=kbEsc) then
  471. begin
  472. CompilationPhase:=cpAborted;
  473. { update info messages }
  474. if assigned(CompilerStatusDialog) then
  475. begin
  476. {$ifdef redircompiler}
  477. RedirDisableAll;
  478. {$endif}
  479. CompilerStatusDialog^.Update;
  480. {$ifdef redircompiler}
  481. RedirEnableAll;
  482. {$endif}
  483. end;
  484. CompilerStatus:=true;
  485. exit;
  486. end;
  487. { only display line info every 100 lines, ofcourse all other messages
  488. will be displayed directly }
  489. if (status.currentline mod 100=0) then
  490. begin
  491. { update info messages }
  492. {$ifdef redircompiler}
  493. RedirDisableAll;
  494. {$endif}
  495. if assigned(CompilerStatusDialog) then
  496. CompilerStatusDialog^.Update;
  497. {$ifdef redircompiler}
  498. RedirEnableAll;
  499. {$endif}
  500. { update memory usage }
  501. { HeapView^.Update; }
  502. end;
  503. CompilerStatus:=false;
  504. end;
  505. procedure CompilerStop; {$ifndef FPC}far;{$endif}
  506. begin
  507. end;
  508. Function CompilerGetNamedFileTime(const filename : string) : Longint; {$ifndef FPC}far;{$endif}
  509. var t: longint;
  510. W: PSourceWindow;
  511. begin
  512. W:=EditorWindowFile(FExpand(filename));
  513. if Assigned(W) and (W^.Editor^.GetModified) then
  514. t:=Now
  515. else
  516. t:=def_getnamedfiletime(filename);
  517. CompilerGetNamedFileTime:=t;
  518. end;
  519. function CompilerOpenInputFile(const filename: string): pinputfile; {$ifndef FPC}far;{$endif}
  520. var f: pinputfile;
  521. W: PSourceWindow;
  522. begin
  523. W:=EditorWindowFile(FExpand(filename));
  524. if Assigned(W) and (W^.Editor^.GetModified) then
  525. f:=new(PFPInputFile, Init(W^.Editor))
  526. else
  527. f:=def_openinputfile(filename);
  528. CompilerOpenInputFile:=f;
  529. end;
  530. function CompilerComment(Level:Longint; const s:string):boolean; {$ifndef FPC}far;{$endif}
  531. begin
  532. {$ifdef TEMPHEAP}
  533. switch_to_base_heap;
  534. {$endif TEMPHEAP}
  535. CompilerComment:=false;
  536. {$ifndef DEV}
  537. if (status.verbosity and Level)=Level then
  538. {$endif}
  539. begin
  540. {$ifdef redircompiler}
  541. RedirDisableAll;
  542. {$endif}
  543. if not CompilerMessageWindow^.GetState(sfVisible) then
  544. CompilerMessageWindow^.Show;
  545. if Desktop^.First<>PView(CompilerMessageWindow) then
  546. CompilerMessageWindow^.MakeFirst;
  547. CompilerMessageWindow^.AddMessage(Level,S,status.currentsourcepath+status.currentsource,
  548. status.currentline,status.currentcolumn);
  549. { update info messages }
  550. if assigned(CompilerStatusDialog) then
  551. CompilerStatusDialog^.Update;
  552. {$ifdef DEBUG}
  553. {$ifndef NODEBUG}
  554. def_gdb_stop(level);
  555. {$endif}
  556. {$endif DEBUG}
  557. {$ifdef redircompiler}
  558. RedirEnableAll;
  559. {$endif}
  560. { update memory usage }
  561. { HeapView^.Update; }
  562. end;
  563. {$ifdef TEMPHEAP}
  564. switch_to_temp_heap;
  565. {$endif TEMPHEAP}
  566. end;
  567. {****************************************************************************
  568. DoCompile
  569. ****************************************************************************}
  570. function GetExePath: string;
  571. var Path: string;
  572. I: Sw_integer;
  573. begin
  574. Path:='.'+DirSep;
  575. if DirectorySwitches<>nil then
  576. with DirectorySwitches^ do
  577. for I:=0 to ItemCount-1 do
  578. begin
  579. if Pos('EXE',KillTilde(ItemName(I)))>0 then
  580. begin Path:=GetStringItem(I); Break; end;
  581. end;
  582. GetExePath:=CompleteDir(FExpand(Path));
  583. end;
  584. function GetMainFile: string;
  585. var FileName: string;
  586. P : PSourceWindow;
  587. begin
  588. P:=Message(Desktop,evBroadcast,cmSearchWindow,nil);
  589. if (PrimaryFileMain='') and (P=nil) then
  590. FileName:='' { nothing to compile }
  591. else
  592. begin
  593. if PrimaryFileMain<>'' then
  594. FileName:=PrimaryFileMain
  595. else
  596. begin
  597. (* if P^.Editor^.GetModified and (not P^.Editor^.Save) then
  598. FileName:='*' { file not saved }
  599. else*) { no longer needed - Gabor }
  600. FileName:=P^.Editor^.FileName;
  601. end;
  602. end;
  603. FileName:=FixFileName(FExpand(FileName));
  604. GetMainFile:=FileName;
  605. end;
  606. procedure DoCompile(Mode: TCompileMode);
  607. function IsExitEvent(E: TEvent): boolean;
  608. begin
  609. IsExitEvent:=(E.What=evKeyDown) and
  610. ((E.KeyCode=kbEnter) or (E.KeyCode=kbEsc)) or
  611. ((E.What=evCommand) and (E.command=cmClose));
  612. end;
  613. var
  614. s,FileName: string;
  615. ErrFile : Text;
  616. Error,LinkErrorCount : longint;
  617. E : TEvent;
  618. DummyView: PView;
  619. const
  620. PpasFile = 'ppas';
  621. begin
  622. { Get FileName }
  623. FileName:=GetMainFile;
  624. if FileName='' then
  625. begin
  626. ErrorBox(msg_nothingtocompile,nil);
  627. Exit;
  628. end else
  629. if FileName='*' then
  630. begin
  631. ErrorBox(msg_cantcompileunsavedfile,nil);
  632. Exit;
  633. end;
  634. PushStatus('Beginning compilation...');
  635. { Show Compiler Messages Window }
  636. { if not CompilerMessageWindow^.GetState(sfVisible) then
  637. CompilerMessageWindow^.Show;
  638. CompilerMessageWindow^.MakeFirst;}
  639. CompilerMessageWindow^.ClearMessages;
  640. { Tell why we compile }
  641. NeedRecompile(true);
  642. MainFile:=FileName;
  643. SetStatus('Writing switches to file...');
  644. WriteSwitches(SwitchesPath);
  645. { leaving open browsers leads to crashes !! (PM) }
  646. SetStatus('Preparing symbol info...');
  647. CloseAllBrowsers;
  648. if ((DesktopFileFlags and dfSymbolInformation)<>0) then
  649. WriteSymbolsFile(BrowserName);
  650. { MainFile:=FixFileName(FExpand(FileName));}
  651. SetStatus('Preparing to compile...');
  652. If GetEXEPath<>'' then
  653. EXEFile:=FixFileName(GetEXEPath+NameOf(MainFile)+ExeExt)
  654. else
  655. EXEFile:=DirOf(MainFile)+NameOf(MainFile)+ExeExt;
  656. { Reset }
  657. CtrlBreakHit:=false;
  658. { Create Compiler Status Dialog }
  659. CompilationPhase:=cpCompiling;
  660. New(CompilerStatusDialog, Init);
  661. CompilerStatusDialog^.SetState(sfModal,true);
  662. Application^.Insert(CompilerStatusDialog);
  663. CompilerStatusDialog^.Update;
  664. { hook compiler output }
  665. {$ifdef TP}
  666. do_status:=CompilerStatus;
  667. do_stop:=CompilerStop;
  668. do_comment:=CompilerComment;
  669. do_openinputfile:=CompilerOpenInputFile;
  670. do_getnamedfiletime:=CompilerGetNamedFileTime;
  671. {$else not TP}
  672. do_status:=@CompilerStatus;
  673. do_stop:=@CompilerStop;
  674. do_comment:=@CompilerComment;
  675. do_openinputfile:=@CompilerOpenInputFile;
  676. do_getnamedfiletime:=@CompilerGetNamedFileTime;
  677. {$endif TP}
  678. do_initsymbolinfo:=InitBrowserCol;
  679. do_donesymbolinfo:=DoneBrowserCol;
  680. do_extractsymbolinfo:=CreateBrowserCol;
  681. { Compile ! }
  682. {$ifdef redircompiler}
  683. ChangeRedirOut(FPOutFileName,false);
  684. ChangeRedirError(FPErrFileName,false);
  685. {$endif}
  686. {$ifdef TEMPHEAP}
  687. split_heap;
  688. switch_to_temp_heap;
  689. {$endif TEMPHEAP}
  690. { insert "" around name so that spaces are allowed }
  691. { only supported in compiler after 2000/01/14 PM }
  692. if pos(' ',FileName)>0 then
  693. FileName:='"'+FileName+'"';
  694. if mode=cBuild then
  695. FileName:='-B '+FileName;
  696. { tokens are created and distroed by compiler.compile !! PM }
  697. DoneTokens;
  698. { it doesn't matter if ppas does not exist
  699. DeleteFile will just retrun the errorcode }
  700. DeleteFile(GetExePath+PpasFile+source_os.scriptext);
  701. SetStatus('Compiling...');
  702. FpIntF.Compile(FileName,SwitchesPath);
  703. SetStatus('Finished compiling...');
  704. { tokens are created and distroed by compiler.compile !! PM }
  705. InitTokens;
  706. if LinkAfter and ExistsFile(GetExePath+PpasFile+source_os.scriptext) and
  707. (CompilationPhase<>cpAborted) and
  708. (status.errorCount=0) then
  709. begin
  710. CompilationPhase:=cpLinking;
  711. CompilerStatusDialog^.Update;
  712. SetStatus('Assembling and/or linking...');
  713. {$ifndef redircompiler}
  714. { At least here we want to catch output
  715. of batch file PM }
  716. ChangeRedirOut(FPOutFileName,false);
  717. ChangeRedirError(FPErrFileName,false);
  718. {$endif}
  719. {$ifdef linux}
  720. Shell(GetExePath+PpasFile+source_os.scriptext);
  721. Error:=LinuxError;
  722. {$else}
  723. DosExecute(GetEnv('COMSPEC'),'/C '+GetExePath+PpasFile+source_os.scriptext);
  724. Error:=DosError;
  725. {$endif}
  726. SetStatus('Finished linking...');
  727. {$ifndef redircompiler}
  728. RestoreRedirOut;
  729. RestoreRedirError;
  730. {$endif}
  731. if Error<>0 then
  732. Inc(status.errorCount);
  733. if IsExe and not ExistsFile(EXEFile) then
  734. begin
  735. Inc(status.errorCount);
  736. ClearFormatParams; AddFormatParamStr(ExeFile);
  737. CompilerMessageWindow^.AddMessage(V_error,FormatStrF(msg_couldnotcreatefile,FormatParams),'',0,0);
  738. {$I-}
  739. Assign(ErrFile,FPErrFileName);
  740. Reset(ErrFile);
  741. if EatIO<>0 then
  742. ErrorBox(FormatStrStr(msg_cantopenfile,FPErrFileName),nil)
  743. else
  744. begin
  745. LinkErrorCount:=0;
  746. While not eof(ErrFile) and (LinkErrorCount<25) do
  747. begin
  748. readln(ErrFile,s);
  749. CompilerMessageWindow^.AddMessage(V_error,s,'',0,0);
  750. inc(LinkErrorCount);
  751. end;
  752. if not eof(ErrFile) then
  753. begin
  754. ClearFormatParams; AddFormatParamStr(FPErrFileName);
  755. CompilerMessageWindow^.AddMessage(V_error,
  756. FormatStrF(msg_therearemoreerrorsinfile,FormatParams),'',0,0);
  757. end;
  758. Close(ErrFile);
  759. end;
  760. EatIO;
  761. {$I+}
  762. end;
  763. end;
  764. {$ifdef TEMPHEAP}
  765. switch_to_base_heap;
  766. {$endif TEMPHEAP}
  767. {$ifdef redircompiler}
  768. RestoreRedirOut;
  769. RestoreRedirError;
  770. {$endif}
  771. PopStatus;
  772. { Set end status }
  773. if CompilationPhase<>cpAborted then
  774. if (status.errorCount=0) then
  775. CompilationPhase:=cpDone
  776. else
  777. CompilationPhase:=cpFailed;
  778. { Show end status }
  779. CompilerStatusDialog^.Update;
  780. CompilerStatusDialog^.SetState(sfModal,false);
  781. if ((CompilationPhase in[cpAborted,cpDone,cpFailed]) or (ShowStatusOnError)) and (Mode<>cRun) then
  782. repeat
  783. CompilerStatusDialog^.GetEvent(E);
  784. if IsExitEvent(E)=false then
  785. CompilerStatusDialog^.HandleEvent(E);
  786. until IsExitEvent(E);
  787. Application^.Delete(CompilerStatusDialog);
  788. Dispose(CompilerStatusDialog, Done);
  789. CompilerStatusDialog:=nil;
  790. { end compilation returns true if the messagewindow should be removed }
  791. if CompilationPhase=cpDone then
  792. begin
  793. CompilerMessageWindow^.Hide;
  794. { This is the last compiled main file }
  795. PrevMainFile:=MainFile;
  796. MainHasDebugInfo:=DebugInfoSwitches^.GetCurrSelParam<>'-';
  797. end;
  798. { Update the app }
  799. Message(Application,evCommand,cmUpdate,nil);
  800. {$ifdef TEMPHEAP}
  801. releasetempheap;
  802. unsplit_heap;
  803. {$endif TEMPHEAP}
  804. DummyView:=Desktop^.First;
  805. while (DummyView<>nil) and (DummyView^.GetState(sfVisible)=false) do
  806. begin
  807. DummyView:=DummyView^.NextView;
  808. end;
  809. with DummyView^ do
  810. if GetState(sfVisible) then
  811. begin
  812. SetState(sfSelected,false);
  813. SetState(sfSelected,true);
  814. end;
  815. if Assigned(CompilerMessageWindow) then
  816. with CompilerMessageWindow^ do
  817. begin
  818. if GetState(sfVisible) then
  819. begin
  820. SetState(sfSelected,false);
  821. SetState(sfSelected,true);
  822. end;
  823. if (status.errorCount>0) then
  824. MsgLB^.SelectFirstError;
  825. end;
  826. { ^^^ we need this trick to reactivate the desktop }
  827. EditorModified:=false;
  828. { Try to read Browser info in again if compilation failure !! }
  829. if Not Assigned(Modules) and (CompilationPhase<>cpDone) and
  830. ((DesktopFileFlags and dfSymbolInformation)<>0) then
  831. ReadSymbolsFile(BrowserName);
  832. end;
  833. function NeedRecompile(verbose : boolean): boolean;
  834. var Need: boolean;
  835. I: sw_integer;
  836. SF: PSourceFile;
  837. SourceTime,PPUTime,ObjTime: longint;
  838. begin
  839. if Assigned(SourceFiles)=false then
  840. Need:={(EditorModified=true)}true
  841. else
  842. begin
  843. Need:=(PrevMainFile<>GetMainFile) and (PrevMainFile<>'');
  844. if Need then
  845. begin
  846. if verbose then
  847. begin
  848. ClearFormatParams; AddFormatParamStr(GetMainFile);
  849. CompilerMessageWindow^.AddMessage(V_info,
  850. FormatStrF(msg_firstcompilationof,FormatParams),
  851. '',0,0);
  852. end;
  853. end
  854. else
  855. for I:=0 to SourceFiles^.Count-1 do
  856. begin
  857. SF:=SourceFiles^.At(I);
  858. SourceTime:=GetFileTime(SF^.GetSourceFileName);
  859. PPUTime:=GetFileTime(SF^.GetPPUFileName);
  860. ObjTime:=GetFileTime(SF^.GetObjFileName);
  861. { writeln('S: ',SF^.GetSourceFileName,' - ',SourceTime);
  862. writeln('P: ',SF^.GetPPUFileName,' - ',PPUTime);
  863. writeln('O: ',SF^.GetObjFileName,' - ',ObjTime);
  864. writeln('------');}
  865. { some units don't generate object files }
  866. if (SourceTime<>-1) then
  867. if (SourceTime>PPUTime) or
  868. ((SourceTime>ObjTime) and
  869. (ObjTime<>-1)) then
  870. begin
  871. Need:=true;
  872. if verbose then
  873. begin
  874. ClearFormatParams; AddFormatParamStr(SF^.GetSourceFileName);
  875. CompilerMessageWindow^.AddMessage(V_info,
  876. FormatStrF(msg_recompilingbecauseof,FormatParams),
  877. SF^.GetSourceFileName,1,1);
  878. end;
  879. Break;
  880. end;
  881. end;
  882. { writeln('Need?', Need); system.readln;}
  883. end;
  884. NeedRecompile:=Need;
  885. end;
  886. constructor TFPInputFile.Init(AEditor: PFileEditor);
  887. begin
  888. if not Assigned(AEditor) then Fail;
  889. if inherited Init(AEditor^.FileName)=false then
  890. Fail;
  891. Editor:=AEditor;
  892. end;
  893. function TFPInputFile.fileopen(const filename: string): boolean;
  894. var OK: boolean;
  895. begin
  896. S:=New(PMemoryStream, Init(0,0));
  897. OK:=Assigned(S) and (S^.Status=stOK);
  898. if OK then OK:=Editor^.SaveToStream(S);
  899. if OK then
  900. S^.Seek(0)
  901. else
  902. begin
  903. if Assigned(S) then Dispose(S, Done);
  904. S:=nil;
  905. end;
  906. fileopen:=OK;
  907. end;
  908. function TFPInputFile.fileseek(pos: longint): boolean;
  909. var OK: boolean;
  910. begin
  911. OK:=assigned(S);
  912. if OK then
  913. begin
  914. S^.Reset;
  915. S^.Seek(pos);
  916. OK:=(S^.Status=stOK);
  917. end;
  918. fileseek:=OK;
  919. end;
  920. function TFPInputFile.fileread(var databuf; maxsize: longint): longint;
  921. var
  922. size: longint;
  923. begin
  924. if not assigned(S) then size:=0 else
  925. begin
  926. size:=min(maxsize,(S^.GetSize-S^.GetPos));
  927. S^.Read(databuf,size);
  928. if S^.Status<>stOK then size:=0;
  929. end;
  930. fileread:=size;
  931. end;
  932. function TFPInputFile.fileeof: boolean;
  933. var EOF: boolean;
  934. begin
  935. EOF:=not assigned(S);
  936. if not EOF then
  937. EOF:=(S^.Status<>stOK) or (S^.GetPos=S^.GetSize);
  938. fileeof:=EOF;
  939. end;
  940. function TFPInputFile.fileclose: boolean;
  941. var OK: boolean;
  942. begin
  943. OK:=assigned(S);
  944. if OK then
  945. begin
  946. S^.Reset;
  947. Dispose(S, Done);
  948. OK:=true;
  949. end;
  950. fileclose:=OK;
  951. end;
  952. procedure RegisterFPCompile;
  953. begin
  954. {$ifndef NOOBJREG}
  955. RegisterType(RCompilerMessageListBox);
  956. RegisterType(RCompilerMessageWindow);
  957. {$endif}
  958. end;
  959. end.
  960. {
  961. $Log$
  962. Revision 1.4 2000-10-04 15:01:11 pierre
  963. * fix IsExe problem
  964. Revision 1.3 2000/09/01 21:33:25 peter
  965. * files to finput
  966. Revision 1.2 2000/08/22 09:41:39 pierre
  967. * first big merge from fixes branch
  968. Revision 1.1.2.4 2000/08/16 18:46:14 peter
  969. [*] double clicking on a droplistbox caused GPF (due to invalid recurson)
  970. [*] Make, Build now possible even in Compiler Messages Window
  971. [+] when started in a new dir the IDE now ask whether to create a local
  972. config, or to use the one located in the IDE dir
  973. Revision 1.1.2.3 2000/08/15 03:40:53 peter
  974. [*] no more fatal exits when the IDE can't find the error file (containing
  975. the redirected assembler/linker output) after compilation
  976. [*] hidden windows are now added always at the end of the Window List
  977. [*] TINIFile parsed entries encapsulated in string delimiters incorrectly
  978. [*] selection was incorrectly adjusted when typing in overwrite mode
  979. [*] the line wasn't expanded when it's end was reached in overw. mode
  980. [*] the IDE now tries to locate source files also in the user specified
  981. unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
  982. [*] 'Open at cursor' is now aware of the extension (if specified)
  983. Revision 1.1.2.2 2000/08/10 07:10:37 michael
  984. * 'Auto save editor files' option did the opposite than expected, due
  985. to a typo in FPIDE.PAS
  986. + saving of source files before compilation is no longer neccessary.
  987. When a modified editor file is involved in the compilation, then the
  988. IDE saves it's contents to a memory stream and passes this to the
  989. compiler (instead of the file on the disk)
  990. Revision 1.1.2.1 2000/07/18 05:50:22 michael
  991. + Merged Gabors fixes
  992. Revision 1.1 2000/07/13 09:48:34 michael
  993. + Initial import
  994. Revision 1.60 2000/06/22 09:07:11 pierre
  995. * Gabor changes: see fixes.txt
  996. Revision 1.59 2000/06/16 08:50:40 pierre
  997. + new bunch of Gabor's changes
  998. Revision 1.58 2000/05/29 10:44:56 pierre
  999. + New bunch of Gabor's changes: see fixes.txt
  1000. Revision 1.57 2000/05/02 08:42:27 pierre
  1001. * new set of Gabor changes: see fixes.txt
  1002. Revision 1.56 2000/04/25 08:42:32 pierre
  1003. * New Gabor changes : see fixes.txt
  1004. Revision 1.55 2000/04/18 11:42:36 pierre
  1005. lot of Gabor changes : see fixes.txt
  1006. Revision 1.54 2000/03/23 22:23:21 pierre
  1007. + Use PushStatus in ParseUserScreen
  1008. Revision 1.53 2000/03/21 23:33:18 pierre
  1009. adapted to wcedit addition by Gabor
  1010. Revision 1.52 2000/03/08 16:48:07 pierre
  1011. + Read BackTrace from UseScreen
  1012. Revision 1.51 2000/03/07 21:54:26 pierre
  1013. + ParseUserScreen
  1014. Revision 1.50 2000/02/06 23:41:42 pierre
  1015. + TCompilerMessageListBox.SelectFirstError
  1016. Revision 1.49 2000/01/25 00:26:35 pierre
  1017. + Browser info saving
  1018. Revision 1.48 2000/01/14 15:38:28 pierre
  1019. + support for long filenames with spaces for compilation
  1020. * avoid too long linker error output
  1021. Revision 1.47 2000/01/03 11:38:33 michael
  1022. Changes from Gabor
  1023. Revision 1.46 1999/12/01 17:08:19 pierre
  1024. * GetFileTime moved to wutils unit
  1025. Revision 1.45 1999/11/22 15:58:40 pierre
  1026. * fix for web bug 633
  1027. Revision 1.44 1999/11/21 01:44:34 pierre
  1028. + Use def_gdb_stop for easy GDB debugging
  1029. Revision 1.43 1999/11/18 13:49:56 pierre
  1030. + use IsExe var to know if we need to call ppas
  1031. Revision 1.42 1999/11/10 17:20:41 pierre
  1032. * Use fpredir.dosexecute
  1033. Revision 1.41 1999/10/25 16:34:19 pierre
  1034. * some units have no object files
  1035. led to wrong NeedRecompile result
  1036. Revision 1.40 1999/09/20 15:36:38 pierre
  1037. * adapted to new tokens unit
  1038. Revision 1.39 1999/09/16 14:34:57 pierre
  1039. + TBreakpoint and TWatch registering
  1040. + WatchesCollection and BreakpointsCollection stored in desk file
  1041. * Syntax highlighting was broken
  1042. Revision 1.38 1999/09/13 16:24:43 peter
  1043. + clock
  1044. * backspace unident like tp7
  1045. Revision 1.37 1999/09/09 14:19:16 pierre
  1046. * status should not be present in TCompilerMessage.GetText
  1047. Revision 1.36 1999/09/07 11:32:13 pierre
  1048. * fix for Linux ./ prepended to ppas.sh
  1049. * Build add '-B' option
  1050. * if linkAfter is set, get errors from linker
  1051. by redirecting files
  1052. Revision 1.35 1999/08/22 22:27:30 pierre
  1053. * not ppas call on compile failure
  1054. Revision 1.34 1999/08/16 18:25:13 peter
  1055. * Adjusting the selection when the editor didn't contain any line.
  1056. * Reserved word recognition redesigned, but this didn't affect the overall
  1057. syntax highlight speed remarkably (at least not on my Amd-K6/350).
  1058. The syntax scanner loop is a bit slow but the main problem is the
  1059. recognition of special symbols. Switching off symbol processing boosts
  1060. the performance up to ca. 200%...
  1061. * The editor didn't allow copying (for ex to clipboard) of a single character
  1062. * 'File|Save as' caused permanently run-time error 3. Not any more now...
  1063. * Compiler Messages window (actually the whole desktop) did not act on any
  1064. keypress when compilation failed and thus the window remained visible
  1065. + Message windows are now closed upon pressing Esc
  1066. + At 'Run' the IDE checks whether any sources are modified, and recompiles
  1067. only when neccessary
  1068. + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
  1069. + LineSelect (Ctrl+K+L) implemented
  1070. * The IDE had problems closing help windows before saving the desktop
  1071. Revision 1.33 1999/08/03 20:22:26 peter
  1072. + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
  1073. + Desktop saving should work now
  1074. - History saved
  1075. - Clipboard content saved
  1076. - Desktop saved
  1077. - Symbol info saved
  1078. * syntax-highlight bug fixed, which compared special keywords case sensitive
  1079. (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
  1080. * with 'whole words only' set, the editor didn't found occourences of the
  1081. searched text, if the text appeared previously in the same line, but didn't
  1082. satisfied the 'whole-word' condition
  1083. * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
  1084. (ie. the beginning of the selection)
  1085. * when started typing in a new line, but not at the start (X=0) of it,
  1086. the editor inserted the text one character more to left as it should...
  1087. * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
  1088. * Shift shouldn't cause so much trouble in TCodeEditor now...
  1089. * Syntax highlight had problems recognizing a special symbol if it was
  1090. prefixed by another symbol character in the source text
  1091. * Auto-save also occours at Dos shell, Tool execution, etc. now...
  1092. Revision 1.32 1999/07/12 13:14:13 pierre
  1093. * LineEnd bug corrected, now goes end of text even if selected
  1094. + Until Return for debugger
  1095. + Code for Quit inside GDB Window
  1096. Revision 1.31 1999/06/28 19:32:17 peter
  1097. * fixes from gabor
  1098. Revision 1.30 1999/06/28 15:59:04 pierre
  1099. * View Linking stage if external linking
  1100. Revision 1.29 1999/06/28 12:39:14 pierre
  1101. + close all browsers before compiling
  1102. Revision 1.28 1999/06/21 23:42:16 pierre
  1103. + LinkAfter and Esc to abort support added
  1104. Revision 1.27 1999/05/22 13:44:29 peter
  1105. * fixed couple of bugs
  1106. Revision 1.26 1999/05/02 14:29:35 peter
  1107. * fixed typo disableredir -> redirdisable
  1108. Revision 1.25 1999/04/29 22:58:09 pierre
  1109. + disabling of redirction in compiler dialogs
  1110. Revision 1.24 1999/04/29 09:36:11 peter
  1111. * fixed hotkeys with Compiler switches
  1112. * fixed compiler status dialog
  1113. * Run shows again the output
  1114. Revision 1.23 1999/04/07 21:55:43 peter
  1115. + object support for browser
  1116. * html help fixes
  1117. * more desktop saving things
  1118. * NODEBUG directive to exclude debugger
  1119. Revision 1.22 1999/04/01 10:27:07 pierre
  1120. + file(line) in start of message added
  1121. Revision 1.21 1999/04/01 10:15:17 pierre
  1122. * CurrSt,InfoSt and LineSt were not disposed correctly in done
  1123. * TComiplerMessage destructor first calls SetCompileShow(false)
  1124. to get proper cleaning up
  1125. Revision 1.20 1999/03/23 16:16:38 peter
  1126. * linux fixes
  1127. Revision 1.19 1999/03/19 16:04:27 peter
  1128. * new compiler dialog
  1129. Revision 1.18 1999/03/16 12:38:07 peter
  1130. * tools macro fixes
  1131. + tph writer
  1132. + first things for resource files
  1133. Revision 1.17 1999/03/12 01:13:56 peter
  1134. * flag if trytoopen should look for other extensions
  1135. + browser tab in the tools-compiler
  1136. Revision 1.16 1999/03/07 23:00:47 pierre
  1137. * Fix for path of executable
  1138. Revision 1.15 1999/03/01 15:41:50 peter
  1139. + Added dummy entries for functions not yet implemented
  1140. * MenuBar didn't update itself automatically on command-set changes
  1141. * Fixed Debugging/Profiling options dialog
  1142. * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
  1143. set
  1144. * efBackSpaceUnindents works correctly
  1145. + 'Messages' window implemented
  1146. + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
  1147. + Added TP message-filter support (for ex. you can call GREP thru
  1148. GREP2MSG and view the result in the messages window - just like in TP)
  1149. * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
  1150. so topic search didn't work...
  1151. * In FPHELP.PAS there were still context-variables defined as word instead
  1152. of THelpCtx
  1153. * StdStatusKeys() was missing from the statusdef for help windows
  1154. + Topic-title for index-table can be specified when adding a HTML-files
  1155. Revision 1.14 1999/02/22 12:46:56 peter
  1156. * small fixes for linux and grep
  1157. Revision 1.13 1999/02/22 11:51:33 peter
  1158. * browser updates from gabor
  1159. Revision 1.12 1999/02/22 11:29:36 pierre
  1160. + added col info in MessageItem
  1161. + grep uses HighLightExts and should work for linux
  1162. Revision 1.11 1999/02/08 09:31:00 florian
  1163. + some split heap stuff, in $ifdef TEMPHEAP
  1164. Revision 1.10 1999/02/05 13:51:39 peter
  1165. * unit name of FPSwitches -> FPSwitch which is easier to use
  1166. * some fixes for tp7 compiling
  1167. Revision 1.9 1999/02/05 13:06:28 pierre
  1168. * allow cmClose for Compilation Dialog box
  1169. Revision 1.8 1999/02/04 13:32:01 pierre
  1170. * Several things added (I cannot commit them independently !)
  1171. + added TBreakpoint and TBreakpointCollection
  1172. + added cmResetDebugger,cmGrep,CmToggleBreakpoint
  1173. + Breakpoint list in INIFile
  1174. * Select items now also depend of SwitchMode
  1175. * Reading of option '-g' was not possible !
  1176. + added search for -Fu args pathes in TryToOpen
  1177. + added code for automatic opening of FileDialog
  1178. if source not found
  1179. Revision 1.7 1999/01/21 11:54:11 peter
  1180. + tools menu
  1181. + speedsearch in symbolbrowser
  1182. * working run command
  1183. Revision 1.6 1999/01/15 16:12:43 peter
  1184. * fixed crash after compile
  1185. Revision 1.5 1999/01/14 21:42:19 peter
  1186. * source tracking from Gabor
  1187. Revision 1.4 1999/01/12 14:29:32 peter
  1188. + Implemented still missing 'switch' entries in Options menu
  1189. + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
  1190. ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
  1191. ASCII chars and inserted directly in the text.
  1192. + Added symbol browser
  1193. * splitted fp.pas to fpide.pas
  1194. Revision 1.3 1999/01/04 11:49:42 peter
  1195. * 'Use tab characters' now works correctly
  1196. + Syntax highlight now acts on File|Save As...
  1197. + Added a new class to syntax highlight: 'hex numbers'.
  1198. * There was something very wrong with the palette managment. Now fixed.
  1199. + Added output directory (-FE<xxx>) support to 'Directories' dialog...
  1200. * Fixed some possible bugs in Running/Compiling, and the compilation/run
  1201. process revised
  1202. Revision 1.2 1998/12/28 15:47:42 peter
  1203. + Added user screen support, display & window
  1204. + Implemented Editor,Mouse Options dialog
  1205. + Added location of .INI and .CFG file
  1206. + Option (INI) file managment implemented (see bottom of Options Menu)
  1207. + Switches updated
  1208. + Run program
  1209. Revision 1.3 1998/12/22 10:39:40 peter
  1210. + options are now written/read
  1211. + find and replace routines
  1212. }