lcl: add Widgetset.LCLCapability function and a set for it with only one member for now lcAsyncProcess

ide: don't use AsyncProcess if widgetset is not capable to handle it (this fixes issues with compiling in qt and gtk2 ide under windows)

git-svn-id: trunk@14710 -
This commit is contained in:
paul 2008-04-01 08:46:13 +00:00
parent fb8f454251
commit 86f7687fe9
6 changed files with 27 additions and 3 deletions

View File

@ -376,7 +376,7 @@ var
FIFOption: TLazFindInFileSearchOption;
begin
// Find- and replace-history
fMaxFindHistory:=XMLConfig.GetValue(Path+'Find/History/Max',FMaxFindHistory);
FMaxFindHistory:=XMLConfig.GetValue(Path+'Find/History/Max',FMaxFindHistory);
LoadRecentList(XMLConfig,FFindHistory,Path+'Find/History/Find/');
LoadRecentList(XMLConfig,FReplaceHistory,Path+'Find/History/Replace/');
LoadRecentList(XMLConfig,FFindInFilesPathHistory,Path+

View File

@ -1089,9 +1089,12 @@ begin
SetupDialogs;
RunExternalTool:=@OnRunExternalTool;
{$IFDEF UseAsyncProcess}
TOutputFilterProcess:=TAsyncProcess;
if Widgetset.LCLCapability(lcAsyncProcess) = 1 then
TOutputFilterProcess := TAsyncProcess
else
TOutputFilterProcess := TProcess;
{$ELSE}
TOutputFilterProcess:=TProcess;
TOutputFilterProcess := TProcess;
{$ENDIF}
MainBuildBoss:=TBuildManager.Create;

View File

@ -53,3 +53,9 @@ procedure TWidgetSet.AppSetTitle(const ATitle: string);
begin
Debugln('TWidgetSet.AppSetTitle not implemented by ', ClassName);
end;
function TWidgetSet.LCLCapability(ACapability: TLCLCapability): PtrUInt;
begin
Result := 0;
end;

View File

@ -67,6 +67,10 @@ type
TLCLPlatforms = set of TLCLPlatform;
TLCLCapability = (
lcAsyncProcess // support for async process
);
{ TWidgetSet }
TWidgetSet = class(TObject)
@ -89,6 +93,7 @@ type
procedure AppSetTitle(const ATitle: string); virtual;
function LCLPlatform: TLCLPlatform; virtual; abstract;
function LCLCapability(ACapability: TLCLCapability): PtrUInt; virtual;
function DCGetPixel(CanvasHandle: HDC; X, Y: integer): TGraphicsColor; virtual; abstract;
procedure DCSetPixel(CanvasHandle: HDC; X, Y: integer; AColor: TGraphicsColor); virtual; abstract;

View File

@ -181,6 +181,7 @@ type
destructor Destroy; override;
function LCLPlatform: TLCLPlatform; override;
function LCLCapability(ACapability: TLCLCapability): PtrUInt; override;
{ Initialize the API }
procedure AppInit(var ScreenInfo: TScreenInfo); override;

View File

@ -410,6 +410,15 @@ begin
Result:= lpWin32;
end;
function TWin32WidgetSet.LCLCapability(ACapability: TLCLCapability): PtrUInt;
begin
case ACapability of
lcAsyncProcess: Result := 1;
else
Result := inherited;
end;
end;
{------------------------------------------------------------------------------
function: CreateTimer
Params: Interval: