lcl: split TAsyncProcess and TProcessUtf8 between 2 units. This is needed to remove widgetset dependency from svn2revision.inc

all others: add/replace new dependency

git-svn-id: trunk@19313 -
This commit is contained in:
paul 2009-04-10 15:33:23 +00:00
parent 36c8c8f079
commit a5a3a8e13e
23 changed files with 178 additions and 133 deletions

1
.gitattributes vendored
View File

@ -4159,6 +4159,7 @@ lcl/themes.pas svneol=native#text/pascal
lcl/tmschema.pas svneol=native#text/pascal
lcl/toolwin.pp svneol=native#text/pascal
lcl/translations.pas svneol=native#text/pascal
lcl/utf8process.pp svneol=native#text/pascal
lcl/utrace.pp svneol=native#text/pascal
lcl/widgetset/README.txt svneol=native#text/plain
lcl/widgetset/wsactnlist.pp svneol=native#text/pascal

View File

@ -5,7 +5,7 @@ unit LHelpControl;
interface
uses
Classes, SysUtils, FileUtil, SimpleIPC, Process, AsyncProcess;
Classes, SysUtils, FileUtil, SimpleIPC, Process, UTF8Process;
type
TRequestType = (rtFile, rtUrl, rtContext);

View File

@ -6,7 +6,7 @@ interface
uses
// General units
Classes, SysUtils, Process, AsyncProcess, DB, Typinfo,
Classes, SysUtils, Process, UTF8Process, DB, Typinfo,
// IDE interface
MenuIntf, propedits, lresources,
// Data dict units

View File

@ -29,7 +29,7 @@ interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
FPDocFiles, StdCtrls, ComCtrls, FileUtil, ExtCtrls,
LCLIntf, LCLType, LCLProc, Process, AsyncProcess, EditBtn, Laz_XMLCfg;
LCLIntf, LCLType, LCLProc, Process, UTF8Process, EditBtn, Laz_XMLCfg;
type

View File

@ -29,7 +29,7 @@ interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
FileUtil, Buttons, ComCtrls, EditBtn, ExtCtrls, ActnList, Grids, Process,
AsyncProcess;
UTF8Process;
type
{ TBuildForm }

View File

@ -29,7 +29,7 @@ interface
uses
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Graphics, Dialogs,
FileUtil, Menus, ActnList, ExtCtrls, ComCtrls, StdCtrls, pgeditor,
process, AsyncProcess, fpdeutil;
process, UTF8Process, fpdeutil;
type
TNodeType = (ntFile,ntPackage,ntModule,ntElement,ntTopic);

View File

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Graphics, Dialogs,
FileUtil, AsyncProcess, Buttons, Process, ExtCtrls;
FileUtil, UTF8Process, Buttons, Process, ExtCtrls;
type
{ TForm1 }

View File

@ -27,14 +27,14 @@ interface
uses
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Graphics, Dialogs,
FileUtil, Clipbrd, StdCtrls, Buttons, Process, AsyncProcess, Menus, ExtCtrls,
UTF8Process, ButtonPanel,
// codetools
KeywordFuncLists, CodeToolManager, FileProcs,
// IDEIntf
ProjectIntf, MacroIntf, IDEExternToolIntf,
// IDE
Project, PackageSystem, ExtToolEditDlg, IDEProcs, EnvironmentOpts,
LazarusIDEStrConsts, PackageDefs, CompilerOptions, TransferMacros, LazConf,
ButtonPanel;
LazarusIDEStrConsts, PackageDefs, CompilerOptions, TransferMacros, LazConf;
type
TCompilerOptionsTest = (

View File

@ -40,7 +40,7 @@ interface
uses
Classes, SysUtils, Process, AsyncProcess, LCLProc, Forms, Controls, FileUtil,
LazarusIDEStrConsts, CompilerOptions, Project, OutputFilter;
LazarusIDEStrConsts, CompilerOptions, Project, OutputFilter, UTF8Process;
type
TOnCmdLineCreate = procedure(var CmdLine: string; var Abort:boolean)

View File

@ -41,7 +41,7 @@ uses
{$ENDIF}
Classes, SysUtils, Process, AsyncProcess, LCLType, LCLProc, Controls, Forms,
Buttons, StdCtrls, ComCtrls, Dialogs, LResources, ExtCtrls,
LazConfigStorage, FileUtil,
LazConfigStorage, FileUtil, UTF8Process,
IDEExternToolIntf, IDEImagesIntf,
ExtToolEditDlg, IDECommands, KeyMapping, TransferMacros, IDEProcs,
InfoBuild, CompilerOptions, OutputFilter, LazarusIDEStrConsts, ButtonPanel;

View File

@ -81,7 +81,7 @@ uses
{$IFDEF unix}
BaseUnix,
{$ENDIF}
Classes, SysUtils, Process, AsyncProcess,
Classes, SysUtils, Process, AsyncProcess, UTF8Process,
LCLProc, FileUtil, Forms, Controls, Dialogs,
LazConf, Splash;

View File

@ -75,7 +75,7 @@ uses
// lcl
LCLProc, LCLMemManager, LCLType, LCLIntf, LConvEncoding, LMessages,
LResources, StdCtrls, Forms, Buttons, Menus, FileUtil, Controls, GraphType,
HelpIntfs, Graphics, ExtCtrls, Dialogs, InterfaceBase, LDockCtrl,
HelpIntfs, Graphics, ExtCtrls, Dialogs, InterfaceBase, LDockCtrl, UTF8Process,
// codetools
LinkScanner, BasicCodeTools, AVL_Tree, Laz_XMLCfg,
CodeToolsStructs, CodeToolManager, CodeCache, DefineTemplates,

View File

@ -9,7 +9,7 @@
*****************************************************************************
* *
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
@ -29,7 +29,7 @@ interface
uses
Classes, Math, SysUtils, Forms, Controls, Dialogs, CompilerOptions,
Process, AsyncProcess, LCLProc, DynQueue, FileUtil,
Process, AsyncProcess, LCLProc, DynQueue, FileUtil, UTF8Process,
IDEDialogs, IDEMsgIntf, IDEExternToolIntf,
IDEProcs, LazConf;

View File

@ -51,7 +51,7 @@ uses
Printers, PostScriptPrinter, PostScriptCanvas, CheckLst, PairSplitter,
ExtDlgs, DBCtrls, DBGrids, DBActns, EditBtn, ExtGraphics, ColorBox,
PropertyStorage, IniPropStorage, XMLPropStorage, Chart, LDockTree, LDockCtrl,
CalendarPopup, Themes, PopupNotifier, ShellCtrls,
CalendarPopup, Themes, PopupNotifier, ShellCtrls, UTF8Process,
LCLMessageGlue,
RubberBand,
// widgetset skeleton

View File

@ -28,40 +28,10 @@ unit AsyncProcess;
interface
uses
Classes, SysUtils, Process, LCLProc, FileUtil, InterfaceBase, LCLIntf;
Classes, SysUtils, Process, LCLProc, FileUtil, InterfaceBase, LCLIntf, UTF8Process;
type
{ TProcessUTF8 }
TProcessUTF8 = class(TProcess)
private
FApplicationNameUTF8: string;
FCommandLineUTF8: string;
FConsoleTitleUTF8: string;
FCurrentDirectoryUTF8: string;
FDesktopUTF8: string;
FEnvironmentUTF8: TStrings;
procedure SetApplicationNameUTF8(const AValue: string);
procedure SetCommandLineUTF8(const AValue: string);
procedure SetConsoleTitleUTF8(const AValue: string);
procedure SetCurrentDirectoryUTF8(const AValue: string);
procedure SetDesktopUTF8(const AValue: string);
procedure SetEnvironmentUTF8(const AValue: TStrings);
procedure UpdateEnvironment;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Execute; override;
property ApplicationName: string read FApplicationNameUTF8 write SetApplicationNameUTF8;
property CommandLine: string read FCommandLineUTF8 write SetCommandLineUTF8;
property ConsoleTitle: string read FConsoleTitleUTF8 write SetConsoleTitleUTF8;
property CurrentDirectory: string read FCurrentDirectoryUTF8 write SetCurrentDirectoryUTF8;
property Desktop: string read FDesktopUTF8 write SetDesktopUTF8;
property Environment: TStrings read FEnvironmentUTF8 write SetEnvironmentUTF8;
end;
{ TAsyncProcess }
TAsyncProcess = class(TProcessUTF8)
@ -87,7 +57,6 @@ type
procedure Register;
implementation
function TAsyncProcess.GetNumBytesAvailable: dword;
@ -143,86 +112,9 @@ begin
FProcessHandler := AddProcessEventHandler(ProcessHandle, @HandleProcessTermination, 0);
end;
{ TProcessUTF8 }
procedure TProcessUTF8.SetApplicationNameUTF8(const AValue: string);
begin
if FApplicationNameUTF8=AValue then exit;
FApplicationNameUTF8:=AValue;
inherited ApplicationName:=UTF8ToSys(FApplicationNameUTF8);
end;
procedure TProcessUTF8.SetCommandLineUTF8(const AValue: string);
begin
if FCommandLineUTF8=AValue then exit;
FCommandLineUTF8:=AValue;
inherited CommandLine:=UTF8ToSys(FCommandLineUTF8);
end;
procedure TProcessUTF8.SetConsoleTitleUTF8(const AValue: string);
begin
if FConsoleTitleUTF8=AValue then exit;
FConsoleTitleUTF8:=AValue;
inherited ConsoleTitle:=UTF8ToSys(FConsoleTitleUTF8);
end;
procedure TProcessUTF8.SetCurrentDirectoryUTF8(const AValue: string);
begin
if FCurrentDirectoryUTF8=AValue then exit;
FCurrentDirectoryUTF8:=AValue;
inherited CurrentDirectory:=UTF8ToSys(FCurrentDirectoryUTF8);
end;
procedure TProcessUTF8.SetDesktopUTF8(const AValue: string);
begin
if FDesktopUTF8=AValue then exit;
FDesktopUTF8:=AValue;
inherited Desktop:=UTF8ToSys(FDesktopUTF8);
end;
procedure TProcessUTF8.SetEnvironmentUTF8(const AValue: TStrings);
begin
if (FEnvironmentUTF8=AValue)
or ((AValue<>nil) and FEnvironmentUTF8.Equals(AValue)) then exit;
FEnvironmentUTF8.Assign(AValue);
end;
procedure TProcessUTF8.UpdateEnvironment;
var
sl: TStringList;
i: Integer;
begin
sl:=TStringList.Create;
try
for i:=0 to FEnvironmentUTF8.Count-1 do
sl.Add(UTF8ToSys(FEnvironmentUTF8[i]));
inherited Environment:=sl;
finally
sl.Free;
end;
end;
constructor TProcessUTF8.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FEnvironmentUTF8:=TStringList.Create;
end;
destructor TProcessUTF8.Destroy;
begin
FreeAndNil(FEnvironmentUTF8);
inherited Destroy;
end;
procedure TProcessUTF8.Execute;
begin
UpdateEnvironment;
inherited Execute;
end;
procedure Register;
begin
RegisterComponents('System',[TProcessUTF8,TAsyncProcess]);
RegisterComponents('System',[TAsyncProcess]);
end;
end.

View File

@ -22,7 +22,7 @@ unit LazHelpHTML;
interface
uses
Classes, SysUtils, LCLProc, Forms, Process, FileUtil, AsyncProcess,
Classes, SysUtils, LCLProc, Forms, Process, FileUtil, UTF8Process,
LazConfigStorage, LCLStrConsts, HelpIntfs, LazHelpIntf;
type

149
lcl/utf8process.pp Normal file
View File

@ -0,0 +1,149 @@
{
/***************************************************************************
UTF8Process.pp
---------------
Initial Revision : Tue Dec 06 09:00:00 CET 2005
***************************************************************************/
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
}
unit UTF8Process;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Process, LCLProc, FileUtil;
type
{ TProcessUTF8 }
TProcessUTF8 = class(TProcess)
private
FApplicationNameUTF8: string;
FCommandLineUTF8: string;
FConsoleTitleUTF8: string;
FCurrentDirectoryUTF8: string;
FDesktopUTF8: string;
FEnvironmentUTF8: TStrings;
procedure SetApplicationNameUTF8(const AValue: string);
procedure SetCommandLineUTF8(const AValue: string);
procedure SetConsoleTitleUTF8(const AValue: string);
procedure SetCurrentDirectoryUTF8(const AValue: string);
procedure SetDesktopUTF8(const AValue: string);
procedure SetEnvironmentUTF8(const AValue: TStrings);
procedure UpdateEnvironment;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Execute; override;
property ApplicationName: string read FApplicationNameUTF8 write SetApplicationNameUTF8;
property CommandLine: string read FCommandLineUTF8 write SetCommandLineUTF8;
property ConsoleTitle: string read FConsoleTitleUTF8 write SetConsoleTitleUTF8;
property CurrentDirectory: string read FCurrentDirectoryUTF8 write SetCurrentDirectoryUTF8;
property Desktop: string read FDesktopUTF8 write SetDesktopUTF8;
property Environment: TStrings read FEnvironmentUTF8 write SetEnvironmentUTF8;
end;
procedure Register;
implementation
{ TProcessUTF8 }
procedure TProcessUTF8.SetApplicationNameUTF8(const AValue: string);
begin
if FApplicationNameUTF8=AValue then exit;
FApplicationNameUTF8:=AValue;
inherited ApplicationName:=UTF8ToSys(FApplicationNameUTF8);
end;
procedure TProcessUTF8.SetCommandLineUTF8(const AValue: string);
begin
if FCommandLineUTF8=AValue then exit;
FCommandLineUTF8:=AValue;
inherited CommandLine:=UTF8ToSys(FCommandLineUTF8);
end;
procedure TProcessUTF8.SetConsoleTitleUTF8(const AValue: string);
begin
if FConsoleTitleUTF8=AValue then exit;
FConsoleTitleUTF8:=AValue;
inherited ConsoleTitle:=UTF8ToSys(FConsoleTitleUTF8);
end;
procedure TProcessUTF8.SetCurrentDirectoryUTF8(const AValue: string);
begin
if FCurrentDirectoryUTF8=AValue then exit;
FCurrentDirectoryUTF8:=AValue;
inherited CurrentDirectory:=UTF8ToSys(FCurrentDirectoryUTF8);
end;
procedure TProcessUTF8.SetDesktopUTF8(const AValue: string);
begin
if FDesktopUTF8=AValue then exit;
FDesktopUTF8:=AValue;
inherited Desktop:=UTF8ToSys(FDesktopUTF8);
end;
procedure TProcessUTF8.SetEnvironmentUTF8(const AValue: TStrings);
begin
if (FEnvironmentUTF8=AValue)
or ((AValue<>nil) and FEnvironmentUTF8.Equals(AValue)) then exit;
FEnvironmentUTF8.Assign(AValue);
end;
procedure TProcessUTF8.UpdateEnvironment;
var
sl: TStringList;
i: Integer;
begin
sl:=TStringList.Create;
try
for i:=0 to FEnvironmentUTF8.Count-1 do
sl.Add(UTF8ToSys(FEnvironmentUTF8[i]));
inherited Environment:=sl;
finally
sl.Free;
end;
end;
constructor TProcessUTF8.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FEnvironmentUTF8:=TStringList.Create;
end;
destructor TProcessUTF8.Destroy;
begin
FreeAndNil(FEnvironmentUTF8);
inherited Destroy;
end;
procedure TProcessUTF8.Execute;
begin
UpdateEnvironment;
inherited Execute;
end;
procedure Register;
begin
RegisterComponents('System',[TProcessUTF8]);
end;
end.

View File

@ -81,6 +81,7 @@ AddFile('textstrings.pas','TextStrings',pftUnit,[],cpBase);
AddFile('toolwin.pp','Toolwin',pftUnit,[],cpBase);
AddFile('translations.pas','Translations',pftUnit,[],cpBase);
AddFile('utrace.pp','UTrace',pftUnit,[],cpBase);
AddFile('utf8process.pp','UTF8Process',pftUnit,[pffHasRegisterProc],cpBase);
AddFile('widgetset/wsactnlist.pp','WSActnList',pftUnit,[],cpBase);
AddFile('widgetset/wsarrow.pp','WSArrow',pftUnit,[],cpBase);
AddFile('widgetset/wsbuttons.pp','WSButtons',pftUnit,[],cpBase);

View File

@ -43,7 +43,7 @@ uses
Dialogs, Spin, Arrow, Calendar, MaskEdit, CheckLst, PairSplitter, ExtDlgs,
StdActns, DBCtrls, DBGrids, DBActns, EditBtn, ActnList, FileCtrl, ButtonPanel,
LResources, XMLPropStorage, IniPropStorage, Graphics, Chart, ColorBox,
LazHelpHTML, PopupNotifier, AsyncProcess, ShellCtrls;
LazHelpHTML, PopupNotifier, AsyncProcess, UTF8Process, ShellCtrls;
procedure Register;
@ -84,6 +84,7 @@ begin
RegisterUnit('LazHelpHTML',@LazHelpHTML.Register);
RegisterUnit('PopupNotifier', @PopupNotifier.Register);
RegisterUnit('AsyncProcess', @AsyncProcess.Register);
RegisterUnit('UTF8Process', @UTF8Process.Register);
RegisterUnit('ShellCtrls', @ShellCtrls.Register);
end;

View File

@ -24,7 +24,7 @@ interface
uses
Classes, SysUtils, Math, process, fpcunit, testregistry,
FileUtil, AsyncProcess, InterfaceBase,
FileUtil, UTF8Process, InterfaceBase,
TestGlobals;
type

View File

@ -23,7 +23,7 @@ unit TestLpi;
interface
uses
Classes, SysUtils, strutils, fpcunit, testregistry, process, AsyncProcess,
Classes, SysUtils, strutils, fpcunit, testregistry, process, UTF8Process,
InterfaceBase, FileUtil,
TestGlobals;

View File

@ -1,12 +1,13 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="/"/>
<Version Value="6"/>
<Version Value="7"/>
<General>
<Flags>
<LRSInOutputDirectory Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
</General>
<PublishOptions>

View File

@ -46,7 +46,7 @@ program Svn2RevisionInc;
{$mode objfpc}{$H+}
uses
Classes, CustApp, SysUtils, Process, AsyncProcess, LCLProc, FileUtil,
Classes, CustApp, SysUtils, Process, UTF8Process, LCLProc, FileUtil,
Dom, XmlRead, GetOpts;
type