mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 14:32:38 +02:00

IDE: Always create project's main icon file when saving it. Keeps its size down. Issue #27287. ........ IDE: Add initial directory for loading project icon in App options. Use IconImage.Picture.Icon everywhere. ........ IDE: Remove resource generation from DoBuildProject. They have been generated earlier. Issue #15915. ........ IDE: Support running external tool with parsers, needed when used through IDE interface. Reported by Anton. ........ IDE: Reduce DebugLn() calls in Publish Module code. It seems to work. ........ IDE: New High-DPI images in folders images/items and images/packages. Kindly provided by Roland Hahn. ........ IDE: Use scaled images in trees of Install/Uninstall package form. ........ IDE: Center icon and text vertically for each item in ViewUnit dialog. Issue #34402, patch from Vojtech Cihak. ........ git-svn-id: branches/fixes_2_0@59281 -
114 lines
2.3 KiB
ObjectPascal
114 lines
2.3 KiB
ObjectPascal
unit ExtToolsIDE;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, SysUtils,
|
|
// LCL
|
|
Forms,
|
|
// LazUtils
|
|
LazLogger,
|
|
// IDEIntf
|
|
IDEExternToolIntf, IDEMsgIntf, PackageIntf, LazIDEIntf,
|
|
// IDE
|
|
ExtTools;
|
|
|
|
type
|
|
{ TExternalToolIDE }
|
|
|
|
TExternalToolIDE = class(TExternalTool)
|
|
private
|
|
procedure SyncAutoFree({%H-}aData: PtrInt); // (main thread)
|
|
protected
|
|
procedure CreateView; override;
|
|
procedure QueueAsyncAutoFree; override;
|
|
public
|
|
constructor Create(aOwner: TComponent); override;
|
|
destructor Destroy; override;
|
|
end;
|
|
|
|
{ TExternalToolsIDE }
|
|
|
|
TExternalToolsIDE = class(TExternalTools)
|
|
public
|
|
constructor Create(aOwner: TComponent); override;
|
|
destructor Destroy; override;
|
|
function GetIDEObject(ToolData: TIDEExternalToolData): TObject; override;
|
|
procedure HandleMesages; override;
|
|
end;
|
|
|
|
|
|
implementation
|
|
|
|
{ TExternalToolIDE }
|
|
|
|
constructor TExternalToolIDE.Create(aOwner: TComponent);
|
|
begin
|
|
inherited Create(aOwner);
|
|
end;
|
|
|
|
destructor TExternalToolIDE.Destroy;
|
|
begin
|
|
inherited Destroy;
|
|
end;
|
|
|
|
procedure TExternalToolIDE.CreateView;
|
|
// this tool generates parsed output => auto create view
|
|
var
|
|
View: TExtToolView;
|
|
begin
|
|
if ViewCount>0 then exit;
|
|
if (ViewCount=0) and (ParserCount>0) and (IDEMessagesWindow<>nil) then
|
|
begin
|
|
View := IDEMessagesWindow.CreateView(Title);
|
|
if View<>nil then
|
|
AddView(View);
|
|
end;
|
|
end;
|
|
|
|
procedure TExternalToolIDE.SyncAutoFree(aData: PtrInt);
|
|
begin
|
|
AutoFree;
|
|
end;
|
|
|
|
procedure TExternalToolIDE.QueueAsyncAutoFree;
|
|
begin
|
|
Application.QueueAsyncCall(@SyncAutoFree,0);
|
|
end;
|
|
|
|
{ TExternalToolsIDE }
|
|
|
|
constructor TExternalToolsIDE.Create(aOwner: TComponent);
|
|
begin
|
|
inherited Create(aOwner);
|
|
FToolClass := TExternalToolIDE;
|
|
end;
|
|
|
|
destructor TExternalToolsIDE.Destroy;
|
|
begin
|
|
inherited Destroy;
|
|
end;
|
|
|
|
function TExternalToolsIDE.GetIDEObject(ToolData: TIDEExternalToolData): TObject;
|
|
begin
|
|
Result:=nil;
|
|
if ToolData=nil then exit;
|
|
if ToolData.Kind=IDEToolCompileProject then begin
|
|
Result:=LazarusIDE.ActiveProject;
|
|
end else if ToolData.Kind=IDEToolCompilePackage then begin
|
|
Result:=PackageEditingInterface.FindPackageWithName(ToolData.ModuleName);
|
|
end else if ToolData.Kind=IDEToolCompileIDE then begin
|
|
Result:=LazarusIDE;
|
|
end;
|
|
end;
|
|
|
|
procedure TExternalToolsIDE.HandleMesages;
|
|
begin
|
|
Application.ProcessMessages;
|
|
end;
|
|
|
|
end.
|
|
|