UPD: Use similar unit names for plugins API

This commit is contained in:
Alexander Koblov 2009-10-21 12:32:44 +00:00
commit 7af01dd5f4
54 changed files with 3798 additions and 4433 deletions

View file

@ -1,133 +1,127 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="/"/>
<Version Value="6"/>
<General>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=""/>
<Title Value="DSXLocate"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<Units Count="3">
<Unit0>
<Filename Value="DSXLocate.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="DSXLocate"/>
<CursorPos X="31" Y="78"/>
<TopLine Value="64"/>
<EditorIndex Value="0"/>
<UsageCount Value="25"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="udsxplugin.pas"/>
<UnitName Value="udsxplugin"/>
<CursorPos X="1" Y="37"/>
<TopLine Value="8"/>
<EditorIndex Value="2"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
<Filename Value="un_process.pas"/>
<UnitName Value="un_process"/>
<CursorPos X="14" Y="27"/>
<TopLine Value="12"/>
<EditorIndex Value="1"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit2>
</Units>
<JumpHistory Count="13" HistoryIndex="12">
<Position1>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="48" Column="5" TopLine="19"/>
</Position1>
<Position2>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="54" Column="7" TopLine="27"/>
</Position2>
<Position3>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="64" Column="11" TopLine="36"/>
</Position3>
<Position4>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="32" Column="19" TopLine="16"/>
</Position4>
<Position5>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="38" Column="22" TopLine="23"/>
</Position5>
<Position6>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="119" Column="14" TopLine="94"/>
</Position6>
<Position7>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="38" Column="22" TopLine="23"/>
</Position7>
<Position8>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="119" Column="14" TopLine="94"/>
</Position8>
<Position9>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="126" Column="8" TopLine="98"/>
</Position9>
<Position10>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="64" Column="5" TopLine="35"/>
</Position10>
<Position11>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="52" Column="42" TopLine="45"/>
</Position11>
<Position12>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="40" Column="15" TopLine="13"/>
</Position12>
<Position13>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="77" Column="3" TopLine="62"/>
</Position13>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<SearchPaths>
<UnitOutputDirectory Value="../lib"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Linking>
<LinkSmart Value="True"/>
<Options>
<ExecutableType Value="Library"/>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
</CONFIG>
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<Version Value="7"/>
<General>
<MainUnit Value="0"/>
<TargetFileExt Value=""/>
<Title Value="DSXLocate"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<Units Count="3">
<Unit0>
<Filename Value="DSXLocate.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="DSXLocate"/>
<CursorPos X="25" Y="69"/>
<TopLine Value="64"/>
<EditorIndex Value="0"/>
<UsageCount Value="25"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="udsxplugin.pas"/>
<UnitName Value="udsxplugin"/>
<CursorPos X="1" Y="37"/>
<TopLine Value="8"/>
<UsageCount Value="13"/>
</Unit1>
<Unit2>
<Filename Value="un_process.pas"/>
<UnitName Value="un_process"/>
<CursorPos X="14" Y="27"/>
<TopLine Value="13"/>
<EditorIndex Value="1"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit2>
</Units>
<JumpHistory Count="13" HistoryIndex="12">
<Position1>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="48" Column="5" TopLine="19"/>
</Position1>
<Position2>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="54" Column="7" TopLine="27"/>
</Position2>
<Position3>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="64" Column="11" TopLine="36"/>
</Position3>
<Position4>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="32" Column="19" TopLine="16"/>
</Position4>
<Position5>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="38" Column="22" TopLine="23"/>
</Position5>
<Position6>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="119" Column="14" TopLine="94"/>
</Position6>
<Position7>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="38" Column="22" TopLine="23"/>
</Position7>
<Position8>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="119" Column="14" TopLine="94"/>
</Position8>
<Position9>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="126" Column="8" TopLine="98"/>
</Position9>
<Position10>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="64" Column="5" TopLine="35"/>
</Position10>
<Position11>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="52" Column="42" TopLine="45"/>
</Position11>
<Position12>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="40" Column="15" TopLine="13"/>
</Position12>
<Position13>
<Filename Value="DSXLocate.lpr"/>
<Caret Line="77" Column="3" TopLine="62"/>
</Position13>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="8"/>
<SearchPaths>
<OtherUnitFiles Value="../../../../sdk/"/>
<UnitOutputDirectory Value="../lib"/>
</SearchPaths>
<Linking>
<LinkSmart Value="True"/>
<Options>
<ExecutableType Value="Library"/>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
</CONFIG>

View file

@ -28,7 +28,7 @@ library DSXLocate;
{$mode objfpc}{$H+}
uses
Classes,sysutils,udsxplugin,un_process;
Classes, SysUtils, DsxPlugin, un_process;
var List:TStringList;
LocatePath:String;

View file

@ -1,61 +0,0 @@
unit udsxplugin;
interface
uses Sysutils;
type
TSearchAttrRecord=record
rFileMask : Pchar;
rAttributes: Cardinal;
rAttribStr : Pchar;
rCaseSens:Boolean;
{Date search}
rIsDateFrom,
rIsDateTo : Boolean;
rDateTimeFrom,
rDateTimeTo : TDateTime;
{Time search}
rIsTimeFrom,
rIsTimeTo : Boolean;
(* File size search *)
rIsFileSizeFrom,
rIsFileSizeTo : Boolean;
rFileSizeFrom,
rFileSizeTo : Int64;
(* Find text *)
rIsNoThisText,
rFindInFiles:Boolean;
rFindData:Pchar;
(* Replace text *)
rReplaceInFiles : Boolean;
rReplaceData : Pchar;
end;
tDSXDefaultParamStruct=record
size,
PluginInterfaceVersionLow,
PluginInterfaceVersionHi:longint;
DefaultIniName:array[0..MAX_PATH-1] of char;
end;
pDSXDefaultParamStruct=^tDSXDefaultParamStruct;
{Prototypes}
{Callbacks procs}
{удалить PlugNr -это не нужно}
TSAddFileProc=procedure (PlugNr:integer; FoundFile:pchar); stdcall;
TSUpdateStatusProc=procedure (PlugNr:integer; CurrentFile:pchar; FilesScaned:integer); stdcall;
{Mandatory (must be implemented)}
{
function Init(dps:pDSXDefaultParamStruct; pAddFileProc:TSAddFileProc; pUpdateStatus:TSUpdateStatusProc):integer; stdcall;
procedure StartSearch(FPluginNr:integer; StartPath:pchar; SearchAttrRec:TSearchAttrRecord); stdcall;
procedure StopSearch(FPluginNr:integer); stdcall;
procedure Finalize(FPluginNr:integer); stdcall;
}
implementation
end.

View file

@ -16,7 +16,7 @@ library cpio;
uses
SysUtils,
Classes,
uWCXhead in 'uWCXhead.pas',
WcxPlugin,
cpio_io in 'cpio_io.pas',
cpio_def in 'cpio_def.pas',
cpio_archive in 'cpio_archive.pas';

View file

@ -28,7 +28,7 @@ interface
uses
Classes,
uWCXhead, uUnixTime,
WcxPlugin, uUnixTime,
cpio_def, cpio_io;
const

View file

@ -6,7 +6,7 @@ interface
uses
Classes,
uWCXhead, uUnixTime,
WcxPlugin, uUnixTime,
deb_def, deb_io;
const

View file

@ -30,7 +30,7 @@ unit lzmafunc;
interface
uses
uWCXhead, ULZMACommon;
WcxPlugin, ULZMACommon;
type
TEncoderOptions = record

View file

@ -16,7 +16,7 @@ library rpm;
uses
SysUtils,
Classes,
uWCXhead in 'uWCXhead.pas',
WcxPlugin,
rpm_io in 'rpm_io.pas',
rpm_def in 'rpm_def.pas',
rpm_archive in 'rpm_archive.pas';

View file

@ -29,7 +29,7 @@ interface
uses
Classes,
uWCXhead, uUnixTime,
WcxPlugin, uUnixTime,
rpm_def, rpm_io;
const

View file

@ -29,7 +29,9 @@
unit bz2func;
interface
uses uWCXhead;
uses
WcxPlugin;
{ Mandatory functions }
function OpenArchive (var ArchiveData : tOpenArchiveData) : TArcHandle;stdcall;

View file

@ -26,7 +26,8 @@ unit UnRARFunc;
interface
uses uWCXhead;
uses
WcxPlugin;
const
UCM_CHANGEVOLUME = 0;

View file

@ -25,8 +25,10 @@
unit ZipFunc;
interface
uses uWCXhead, AbZipKit, AbArcTyp, AbZipTyp, DialogAPI,
AbExcept, AbUtils;
uses
WcxPlugin, AbZipKit, AbArcTyp, AbZipTyp, DialogAPI,
AbExcept, AbUtils;
type
TAbZipKitEx = class (TAbZipKit)

View file

@ -1,62 +0,0 @@
unit contplug; { Contents of file contplug.pas }
interface
uses
SysUtils;
const ft_nomorefields=0;
ft_numeric_32=1;
ft_numeric_64=2;
ft_numeric_floating=3;
ft_date=4;
ft_time=5;
ft_boolean=6;
ft_multiplechoice=7;
ft_string=8;
ft_fulltext=9;
ft_datetime=10;
// for ContentGetValue
ft_nosuchfield=-1;
ft_fileerror=-2;
ft_fieldempty=-3;
ft_ondemand=-4;
ft_delayed=0;
CONTENT_DELAYIFSLOW=1; // ContentGetValue called in foreground
type tContentDefaultParamStruct=record
size,
PluginInterfaceVersionLow,
PluginInterfaceVersionHi:longint;
DefaultIniName:array[0..MAX_PATH-1] of char;
end;
pContentDefaultParamStruct=^tContentDefaultParamStruct;
type tdateformat=record
wYear,wMonth,wDay:word;
end;
pdateformat=^tdateformat;
type ttimeformat=record
wHour,wMinute,wSecond:word;
end;
ptimeformat=^ttimeformat;
{ Function prototypes: }
{
procedure ContentGetDetectString(DetectString:pchar;maxlen:integer); stdcall;
function ContentGetSupportedField(FieldIndex:integer;FieldName:pchar;
Units:pchar;maxlen:integer):integer; stdcall;
function ContentGetValue(FileName:pchar;FieldIndex,UnitIndex:integer;FieldValue:pbyte;
maxlen,flags:integer):integer; stdcall;
procedure ContentSetDefaultParams(dps:pContentDefaultParamStruct); stdcall;
procedure ContentStopGetValue(FileName:pchar); stdcall;
function ContentGetDefaultSortOrder(FieldIndex:integer):integer; stdcall;
}
implementation
end.

View file

@ -14,7 +14,7 @@ library deb_wdx;
uses
SysUtils,
Classes,
contplug in 'contplug.pas',
WdxPlugin,
deb_wdx_intf in 'deb_wdx_intf.pas';
{$E wdx}

View file

@ -1,176 +1,177 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="7"/>
<General>
<MainUnit Value="0"/>
<TargetFileExt Value=".exe"/>
<Icon Value="0"/>
<UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<Units Count="8">
<Unit0>
<Filename Value="deb_wdx.dpr"/>
<IsPartOfProject Value="True"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit0>
<Unit1>
<Filename Value="gzip.pas"/>
<UnitName Value="gzip"/>
<CursorPos X="30" Y="11"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit1>
<Unit2>
<Filename Value="debunpak.pas"/>
<UnitName Value="debunpak"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit2>
<Unit3>
<Filename Value="minigzip.pas"/>
<UnitName Value="minigzip"/>
<CursorPos X="25" Y="16"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit3>
<Unit4>
<Filename Value="UnTar.pas"/>
<UnitName Value="UnTar"/>
<CursorPos X="31" Y="109"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit4>
<Unit5>
<Filename Value="deb_wdx_intf.pas"/>
<UnitName Value="deb_wdx_intf"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="1"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit5>
<Unit6>
<Filename Value="..\..\..\Alexx\Prog\FreePascal\FPC\2.2.2\src\rtl\objpas\sysutils\osutilsh.inc"/>
<CursorPos X="10" Y="32"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit6>
<Unit7>
<Filename Value="contplug.pas"/>
<UnitName Value="contplug"/>
<CursorPos X="32" Y="8"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit7>
</Units>
<JumpHistory Count="9" HistoryIndex="8">
<Position1>
<Filename Value="deb_wdx_intf.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="deb_wdx.dpr"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position2>
<Position3>
<Filename Value="deb_wdx.dpr"/>
<Caret Line="26" Column="1" TopLine="1"/>
</Position3>
<Position4>
<Filename Value="deb_wdx.dpr"/>
<Caret Line="16" Column="9" TopLine="1"/>
</Position4>
<Position5>
<Filename Value="deb_wdx.dpr"/>
<Caret Line="7" Column="56" TopLine="1"/>
</Position5>
<Position6>
<Filename Value="deb_wdx_intf.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position6>
<Position7>
<Filename Value="deb_wdx_intf.pas"/>
<Caret Line="36" Column="49" TopLine="21"/>
</Position7>
<Position8>
<Filename Value="deb_wdx_intf.pas"/>
<Caret Line="36" Column="49" TopLine="1"/>
</Position8>
<Position9>
<Filename Value="deb_wdx.dpr"/>
<Caret Line="13" Column="32" TopLine="1"/>
</Position9>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="8"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)\"/>
<UnitOutputDirectory Value="..\lib"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
<CStyleOperator Value="False"/>
<UseAnsiStrings Value="True"/>
</SyntaxOptions>
</Parsing>
<Linking>
<LinkSmart Value="True"/>
<Options>
<ExecutableType Value="Library"/>
</Options>
</Linking>
<Other>
<ConfigFile>
<CustomConfigFile Value="True"/>
<ConfigFilePath Value="fpc-extra.cfg"/>
</ConfigFile>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="7"/>
<General>
<MainUnit Value="0"/>
<TargetFileExt Value=".exe"/>
<Icon Value="0"/>
<UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<Units Count="8">
<Unit0>
<Filename Value="deb_wdx.dpr"/>
<IsPartOfProject Value="True"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit0>
<Unit1>
<Filename Value="gzip.pas"/>
<UnitName Value="gzip"/>
<CursorPos X="30" Y="11"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit1>
<Unit2>
<Filename Value="debunpak.pas"/>
<UnitName Value="debunpak"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit2>
<Unit3>
<Filename Value="minigzip.pas"/>
<UnitName Value="minigzip"/>
<CursorPos X="25" Y="16"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit3>
<Unit4>
<Filename Value="UnTar.pas"/>
<UnitName Value="UnTar"/>
<CursorPos X="31" Y="109"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit4>
<Unit5>
<Filename Value="deb_wdx_intf.pas"/>
<UnitName Value="deb_wdx_intf"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="1"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit5>
<Unit6>
<Filename Value="..\..\..\Alexx\Prog\FreePascal\FPC\2.2.2\src\rtl\objpas\sysutils\osutilsh.inc"/>
<CursorPos X="10" Y="32"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit6>
<Unit7>
<Filename Value="contplug.pas"/>
<UnitName Value="contplug"/>
<CursorPos X="32" Y="8"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit7>
</Units>
<JumpHistory Count="9" HistoryIndex="8">
<Position1>
<Filename Value="deb_wdx_intf.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="deb_wdx.dpr"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position2>
<Position3>
<Filename Value="deb_wdx.dpr"/>
<Caret Line="26" Column="1" TopLine="1"/>
</Position3>
<Position4>
<Filename Value="deb_wdx.dpr"/>
<Caret Line="16" Column="9" TopLine="1"/>
</Position4>
<Position5>
<Filename Value="deb_wdx.dpr"/>
<Caret Line="7" Column="56" TopLine="1"/>
</Position5>
<Position6>
<Filename Value="deb_wdx_intf.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position6>
<Position7>
<Filename Value="deb_wdx_intf.pas"/>
<Caret Line="36" Column="49" TopLine="21"/>
</Position7>
<Position8>
<Filename Value="deb_wdx_intf.pas"/>
<Caret Line="36" Column="49" TopLine="1"/>
</Position8>
<Position9>
<Filename Value="deb_wdx.dpr"/>
<Caret Line="13" Column="32" TopLine="1"/>
</Position9>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="8"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)\"/>
<OtherUnitFiles Value="..\..\..\..\sdk\"/>
<UnitOutputDirectory Value="..\lib"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
<CStyleOperator Value="False"/>
<UseAnsiStrings Value="True"/>
</SyntaxOptions>
</Parsing>
<Linking>
<LinkSmart Value="True"/>
<Options>
<ExecutableType Value="Library"/>
</Options>
</Linking>
<Other>
<ConfigFile>
<CustomConfigFile Value="True"/>
<ConfigFilePath Value="fpc-extra.cfg"/>
</ConfigFile>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View file

@ -22,7 +22,7 @@ unit deb_wdx_intf;
interface
uses
Classes, contplug;
Classes, WdxPlugin;
procedure ContentGetDetectString(DetectString:pchar; maxlen:integer); stdcall;
function ContentGetSupportedField(FieldIndex:integer;FieldName:pchar;

View file

@ -1,143 +1,146 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="6"/>
<General>
<MainUnit Value="0"/>
<IconPath Value=".\"/>
<TargetFileExt Value=""/>
<ActiveEditorIndexAtStart Value="3"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<DestinationDirectory Value="$(TestDir)\publishedproject\"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="8">
<Unit0>
<Filename Value="rpm_wdx.dpr"/>
<IsPartOfProject Value="True"/>
<CursorPos X="6" Y="20"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="rpm_io.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="rpm_io"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="4"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
<Filename Value="rpm_wdx_intf.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="rpm_wdx_intf"/>
<CursorPos X="35" Y="14"/>
<TopLine Value="1"/>
<EditorIndex Value="2"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="rpm_def.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="rpm_def"/>
<CursorPos X="13" Y="12"/>
<TopLine Value="1"/>
<EditorIndex Value="1"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit3>
<Unit4>
<Filename Value="contplug.pas"/>
<UnitName Value="contplug"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit4>
<Unit5>
<Filename Value="ucontplugin.pas"/>
<UnitName Value="ucontplugin"/>
<CursorPos X="15" Y="5"/>
<TopLine Value="1"/>
<EditorIndex Value="3"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit5>
<Unit6>
<Filename Value="uOSUtils.pas"/>
<UnitName Value="uOSUtils"/>
<CursorPos X="1" Y="35"/>
<TopLine Value="8"/>
<UsageCount Value="10"/>
</Unit6>
<Unit7>
<Filename Value="ufindex.pas"/>
<UnitName Value="ufindex"/>
<CursorPos X="5" Y="44"/>
<TopLine Value="29"/>
<UsageCount Value="10"/>
</Unit7>
</Units>
<JumpHistory Count="0" HistoryIndex="-1"/>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<SearchPaths>
<UnitOutputDirectory Value="..\lib"/>
</SearchPaths>
<PathDelim Value="\"/>
<Parsing>
<SyntaxOptions>
<DelphiCompat Value="True"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Linking>
<LinkSmart Value="True"/>
<Options>
<ExecutableType Value="Library"/>
</Options>
</Linking>
<Other>
<ConfigFile>
<CustomConfigFile Value="True"/>
<ConfigFilePath Value="fpc-extra.cfg"/>
</ConfigFile>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Watches Count="1">
<Item1>
<Expression Value="CurrFileName"/>
</Item1>
</Watches>
</Debugging>
</CONFIG>
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="7"/>
<General>
<MainUnit Value="0"/>
<TargetFileExt Value=""/>
<ActiveEditorIndexAtStart Value="3"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<DestinationDirectory Value="$(TestDir)\publishedproject\"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="8">
<Unit0>
<Filename Value="rpm_wdx.dpr"/>
<IsPartOfProject Value="True"/>
<CursorPos X="6" Y="20"/>
<TopLine Value="6"/>
<EditorIndex Value="0"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit0>
<Unit1>
<Filename Value="rpm_io.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="rpm_io"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="3"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit1>
<Unit2>
<Filename Value="rpm_wdx_intf.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="rpm_wdx_intf"/>
<CursorPos X="35" Y="14"/>
<TopLine Value="1"/>
<EditorIndex Value="2"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit2>
<Unit3>
<Filename Value="rpm_def.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="rpm_def"/>
<CursorPos X="13" Y="12"/>
<TopLine Value="1"/>
<EditorIndex Value="1"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit3>
<Unit4>
<Filename Value="contplug.pas"/>
<UnitName Value="contplug"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit4>
<Unit5>
<Filename Value="ucontplugin.pas"/>
<UnitName Value="ucontplugin"/>
<CursorPos X="15" Y="5"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit5>
<Unit6>
<Filename Value="uOSUtils.pas"/>
<UnitName Value="uOSUtils"/>
<CursorPos X="1" Y="35"/>
<TopLine Value="8"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit6>
<Unit7>
<Filename Value="ufindex.pas"/>
<UnitName Value="ufindex"/>
<CursorPos X="5" Y="44"/>
<TopLine Value="29"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="Delphi"/>
</Unit7>
</Units>
<JumpHistory Count="0" HistoryIndex="-1"/>
</ProjectOptions>
<CompilerOptions>
<Version Value="8"/>
<PathDelim Value="\"/>
<SearchPaths>
<OtherUnitFiles Value="..\..\..\..\sdk\"/>
<UnitOutputDirectory Value="..\lib"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<LinkSmart Value="True"/>
<Options>
<ExecutableType Value="Library"/>
</Options>
</Linking>
<Other>
<ConfigFile>
<CustomConfigFile Value="True"/>
<ConfigFilePath Value="fpc-extra.cfg"/>
</ConfigFile>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Watches Count="1">
<Item1>
<Expression Value="CurrFileName"/>
</Item1>
</Watches>
</Debugging>
</CONFIG>

View file

@ -11,7 +11,7 @@ function ContentGetValue(FileName:pchar;FieldIndex,UnitIndex:integer;FieldValue:
implementation
uses SysUtils, {contplug,}ucontplugin, rpm_io, rpm_def;
uses SysUtils, WdxPlugin, rpm_io, rpm_def;
const
IDX_PACKAGE = 0;

View file

@ -1,96 +0,0 @@
unit ucontplugin; { Contents of file contplug.pas }
interface
uses SysUtils;
const ft_nomorefields=0;
ft_numeric_32=1;
ft_numeric_64=2;
ft_numeric_floating=3;
ft_date=4;
ft_time=5;
ft_boolean=6;
ft_multiplechoice=7;
ft_string=8;
ft_fulltext=9;
ft_datetime=10;
// for ContentGetValue
ft_nosuchfield=-1;
ft_fileerror=-2;
ft_fieldempty=-3;
ft_ondemand=-4;
ft_notsupported=-5;
ft_setcancel=-6;
ft_delayed=0;
// for ContentSetValue
ft_setsuccess=0; // setting of the attribute succeeded
// for ContentGetSupportedFieldFlags
contflags_edit=1;
contflags_substsize=2;
contflags_substdatetime=4;
contflags_substdate=6;
contflags_substtime=8;
contflags_substattributes=10;
contflags_substattributestr=12;
contflags_passthrough_size_float=14;
contflags_substmask=14;
contflags_fieldedit=16;
// for ContentSendStateInformation
contst_readnewdir=1;
contst_refreshpressed=2;
contst_showhint=4;
setflags_first_attribute=1; // First attribute of this file
setflags_last_attribute=2; // Last attribute of this file
setflags_only_date=4; // Only set the date of the datetime value!
CONTENT_DELAYIFSLOW=1; // ContentGetValue called in foreground
CONTENT_PASSTHROUGH=2; // If requested via contflags_passthrough_size_float: The size
// is passed in as floating value, TC expects correct value
// from the given units value, and optionally a text string
type tContentDefaultParamStruct=record
size,
PluginInterfaceVersionLow,
PluginInterfaceVersionHi:longint;
DefaultIniName:array[0..MAX_PATH-1] of char;
end;
pContentDefaultParamStruct=^tContentDefaultParamStruct;
type tdateformat=record
wYear,wMonth,wDay:word;
end;
pdateformat=^tdateformat;
type ttimeformat=record
wHour,wMinute,wSecond:word;
end;
ptimeformat=^ttimeformat;
{ Function prototypes: }
{
procedure ContentGetDetectString(DetectString:pchar;maxlen:integer); stdcall;
function ContentGetSupportedField(FieldIndex:integer;FieldName:pchar;
Units:pchar;maxlen:integer):integer; stdcall;
function ContentGetValue(FileName:pchar;FieldIndex,UnitIndex:integer;FieldValue:pbyte;
maxlen,flags:integer):integer; stdcall;
procedure ContentSetDefaultParams(dps:pContentDefaultParamStruct); stdcall;
procedure ContentPluginUnloading; stdcall;
procedure ContentStopGetValue(FileName:pchar); stdcall;
function ContentGetDefaultSortOrder(FieldIndex:integer):integer; stdcall;
function ContentGetSupportedFieldFlags(FieldIndex:integer):integer; stdcall;
function ContentSetValue(FileName:pchar;FieldIndex,UnitIndex,FieldType:integer;
FieldValue:pbyte;flags:integer):integer; stdcall;
procedure ContentSendStateInformation(state:integer;path:pchar); stdcall;
function ContentEditValue(handle:thandle;FieldIndex,UnitIndex,FieldType:integer;
FieldValue:pchar;maxlen:integer;flags:integer;langidentifier:pchar):integer; stdcall;
}
implementation
end.

View file

@ -7,7 +7,7 @@ unit NetFunc;
interface
uses
Windows, SysUtils, Classes, NetUtils, ufsplugin;
Windows, SysUtils, Classes, NetUtils, WfxPlugin;
function FsInit(PluginNr: Integer; pProgressProc: TProgressProc; pLogProc: TLogProc; pRequestProc: TRequestProc): Integer; stdcall;

View file

@ -33,7 +33,7 @@ uses
{$IFDEF MSWINDOWS}
Windows,
{$ENDIF}
ufsplugin, FtpSend, DialogAPI;
WfxPlugin, FtpSend, DialogAPI;
type
TFTPSendEx = class(TFTPSend)

View file

@ -1,95 +1,85 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="/"/>
<Version Value="6"/>
<General>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=""/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<Units Count="5">
<Unit0>
<Filename Value="sample.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="Sample"/>
<CursorPos X="50" Y="32"/>
<TopLine Value="22"/>
<EditorIndex Value="0"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="ufsplugin.pas"/>
<UnitName Value="ufsplugin"/>
<CursorPos X="1" Y="252"/>
<TopLine Value="238"/>
<EditorIndex Value="3"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
<Filename Value="uOSUtils.pas"/>
<UnitName Value="uOSUtils"/>
<CursorPos X="1" Y="64"/>
<TopLine Value="56"/>
<UsageCount Value="10"/>
</Unit2>
<Unit3>
<Filename Value="uwfxmodule.pas"/>
<UnitName Value="uWFXmodule"/>
<CursorPos X="3" Y="726"/>
<TopLine Value="694"/>
<EditorIndex Value="2"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit3>
<Unit4>
<Filename Value="PLUGIN_TYPES.pas"/>
<UnitName Value="PLUGIN_Types"/>
<CursorPos X="1" Y="149"/>
<TopLine Value="121"/>
<EditorIndex Value="1"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit4>
</Units>
<JumpHistory Count="0" HistoryIndex="-1"/>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<SearchPaths>
<UnitOutputDirectory Value="../lib"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Linking>
<LinkSmart Value="True"/>
<Options>
<ExecutableType Value="Library"/>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
</CONFIG>
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<Version Value="7"/>
<General>
<MainUnit Value="0"/>
<TargetFileExt Value=""/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<Units Count="5">
<Unit0>
<Filename Value="sample.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="Sample"/>
<CursorPos X="40" Y="26"/>
<TopLine Value="22"/>
<EditorIndex Value="0"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="ufsplugin.pas"/>
<UnitName Value="ufsplugin"/>
<CursorPos X="1" Y="252"/>
<TopLine Value="238"/>
<UsageCount Value="10"/>
</Unit1>
<Unit2>
<Filename Value="uOSUtils.pas"/>
<UnitName Value="uOSUtils"/>
<CursorPos X="1" Y="64"/>
<TopLine Value="56"/>
<UsageCount Value="10"/>
</Unit2>
<Unit3>
<Filename Value="uwfxmodule.pas"/>
<UnitName Value="uWFXmodule"/>
<CursorPos X="3" Y="726"/>
<TopLine Value="694"/>
<UsageCount Value="10"/>
</Unit3>
<Unit4>
<Filename Value="PLUGIN_TYPES.pas"/>
<UnitName Value="PLUGIN_Types"/>
<CursorPos X="1" Y="149"/>
<TopLine Value="121"/>
<UsageCount Value="10"/>
</Unit4>
</Units>
<JumpHistory Count="0" HistoryIndex="-1"/>
</ProjectOptions>
<CompilerOptions>
<Version Value="8"/>
<SearchPaths>
<OtherUnitFiles Value="../../../../sdk/"/>
<UnitOutputDirectory Value="../lib"/>
</SearchPaths>
<Linking>
<LinkSmart Value="True"/>
<Options>
<ExecutableType Value="Library"/>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
</CONFIG>

View file

@ -10,7 +10,7 @@ uses
baseunix,
{$ENDIF}
Classes,
ufsplugin,
WfxPlugin,
SysUtils;

View file

@ -1,409 +0,0 @@
unit ufsplugin; {Plugin definitions version 1.5}
interface
uses SysUtils {$IFDEF WINDOWS}, Windows{$ENDIF};
{ ids for FsGetFile }
const FS_FILE_OK=0;
FS_FILE_EXISTS=1;
FS_FILE_NOTFOUND=2;
FS_FILE_READERROR=3;
FS_FILE_WRITEERROR=4;
FS_FILE_USERABORT=5;
FS_FILE_NOTSUPPORTED=6;
FS_FILE_EXISTSRESUMEALLOWED=7;
FS_EXEC_OK=0;
FS_EXEC_ERROR=1;
FS_EXEC_YOURSELF=-1;
FS_EXEC_SYMLINK=-2;
FS_COPYFLAGS_OVERWRITE=1;
FS_COPYFLAGS_RESUME=2;
FS_COPYFLAGS_MOVE=4;
FS_COPYFLAGS_EXISTS_SAMECASE=8;
FS_COPYFLAGS_EXISTS_DIFFERENTCASE=16;
{ flags for tRequestProc }
const
RT_Other=0;
RT_UserName=1;
RT_Password=2;
RT_Account=3;
RT_UserNameFirewall=4;
RT_PasswordFirewall=5;
RT_TargetDir=6;
RT_URL=7;
RT_MsgOK=8;
RT_MsgYesNo=9;
RT_MsgOKCancel=10;
{ flags for tLogProc }
const msgtype_connect=1;
msgtype_disconnect=2;
msgtype_details=3;
msgtype_transfercomplete=4;
msgtype_connectcomplete=5;
msgtype_importanterror=6;
msgtype_operationcomplete=7;
{ flags for FsStatusInfo }
const FS_STATUS_START=0;
FS_STATUS_END=1;
FS_STATUS_OP_LIST=1;
FS_STATUS_OP_GET_SINGLE=2;
FS_STATUS_OP_GET_MULTI=3;
FS_STATUS_OP_PUT_SINGLE=4;
FS_STATUS_OP_PUT_MULTI=5;
FS_STATUS_OP_RENMOV_SINGLE=6;
FS_STATUS_OP_RENMOV_MULTI=7;
FS_STATUS_OP_DELETE=8;
FS_STATUS_OP_ATTRIB=9;
FS_STATUS_OP_MKDIR=10;
FS_STATUS_OP_EXEC=11;
FS_STATUS_OP_CALCSIZE=12;
FS_STATUS_OP_SEARCH=13;
FS_STATUS_OP_SEARCH_TEXT=14;
FS_STATUS_OP_SYNC_SEARCH=15;
FS_STATUS_OP_SYNC_GET=16;
FS_STATUS_OP_SYNC_PUT=17;
FS_STATUS_OP_SYNC_DELETE=18;
{Flags for FsExtractCustomIcon}
const FS_ICONFLAG_SMALL=1;
FS_ICONFLAG_BACKGROUND=2;
FS_ICON_USEDEFAULT=0;
FS_ICON_EXTRACTED=1;
FS_ICON_EXTRACTED_DESTROY=2;
FS_ICON_DELAYED=3;
const FS_BITMAP_NONE=0;
FS_BITMAP_EXTRACTED=1;
FS_BITMAP_EXTRACT_YOURSELF=2;
FS_BITMAP_EXTRACT_YOURSELF_ANDDELETE=3;
FS_BITMAP_CACHE=256;
const
MAXDWORD = DWORD($FFFFFFFF);
type
TInt64Rec = packed record
case Boolean of
True : (Value : Int64);
False : (Low,High : DWORD);
end;
BOOL = LongBool;
HBITMAP = THandle;
HICON = THandle;
type
{$IFDEF WINDOWS}
FILETIME = Windows.FILETIME;
{$ELSE}
FILETIME = record
dwLowDateTime : DWORD;
dwHighDateTime : DWORD;
end;
{$ENDIF}
TFileTime = FILETIME;
PFileTime = ^FILETIME;
WIN32_FIND_DATA = record
dwFileAttributes : DWORD;
ftCreationTime : TFILETIME;
ftLastAccessTime : TFILETIME;
ftLastWriteTime : TFILETIME;
nFileSizeHigh : DWORD;
nFileSizeLow : DWORD;
dwReserved0 : DWORD;
dwReserved1 : DWORD;
cFileName : array[0..(MAX_PATH)-1] of CHAR;
cAlternateFileName : array[0..13] of CHAR;
end;
TWin32FindData = WIN32_FIND_DATA;
type
tRemoteInfo=record
SizeLow,SizeHigh:longint;
LastWriteTime:TFileTime;
Attr:longint;
end;
pRemoteInfo=^tRemoteInfo;
type
tFsDefaultParamStruct=record
size,
PluginInterfaceVersionLow,
PluginInterfaceVersionHi:longint;
DefaultIniName:array[0..MAX_PATH-1] of char;
end;
pFsDefaultParamStruct=^tFsDefaultParamStruct;
{ callback functions }
type
TProgressProc=function(PluginNr:integer;SourceName,
TargetName:pchar;PercentDone:integer):integer; stdcall;
TLogProc=procedure(PluginNr,MsgType:integer;LogString:pchar); stdcall;
TRequestProc=function(PluginNr,RequestType:integer;CustomTitle,CustomText,
ReturnedText:pchar;maxlen:integer):boolean; stdcall;
{ Function prototypes - the callback functions MUST be implemented exactly like this! }
{
function FsInit(PluginNr:integer;pProgressProc:tProgressProc;pLogProc:tLogProc;
pRequestProc:tRequestProc):integer; stdcall;
function FsFindFirst(path :pchar;var FindData:tWIN32FINDDATA):thandle; stdcall;
function FsFindNext(Hdl:thandle;var FindData:tWIN32FINDDATA):bool; stdcall;
function FsFindClose(Hdl:thandle):integer; stdcall;
function FsMkDir(RemoteDir:pchar):bool; stdcall;
function FsExecuteFile(MainWin:thandle;RemoteName,Verb:pchar):integer; stdcall;
function FsRenMovFile(OldName,NewName:pchar;Move,OverWrite:bool;
RemoteInfo:pRemoteInfo):integer; stdcall;
function FsGetFile(RemoteName,LocalName:pchar;CopyFlags:integer;
RemoteInfo:pRemoteInfo):integer; stdcall;
function FsPutFile(LocalName,RemoteName:pchar;CopyFlags:integer):integer; stdcall;
function FsDeleteFile(RemoteName:pchar):bool; stdcall;
function FsRemoveDir(RemoteName:pchar):bool; stdcall;
function FsDisconnect(DisconnectRoot:pchar):bool; stdcall;
function FsSetAttr(RemoteName:pchar;NewAttr:integer):bool; stdcall;
function FsSetTime(RemoteName:pchar;CreationTime,LastAccessTime,
LastWriteTime:PFileTime):bool; stdcall;
procedure FsStatusInfo(RemoteDir:pchar;InfoStartEnd,InfoOperation:integer); stdcall;
procedure FsGetDefRootName(DefRootName:pchar;maxlen:integer); stdcall;
function FsExtractCustomIcon(RemoteName:pchar;ExtractFlags:integer;
var TheIcon:hicon):integer; stdcall;
procedure FsSetDefaultParams(dps:pFsDefaultParamStruct); stdcall;
function FsGetPreviewBitmap(RemoteName:pchar,width,height:integer,
var ReturnedBitmap:hbitmap):integer; stdcall;
function FsLinksToLocalFiles:bool; stdcall;
function FsGetLocalName(RemoteName:pchar;maxlen:integer):bool; stdcall;
}
{****************************** content plugin part *****************************}
const ft_nomorefields=0;
ft_numeric_32=1;
ft_numeric_64=2;
ft_numeric_floating=3;
ft_date=4;
ft_time=5;
ft_boolean=6;
ft_multiplechoice=7;
ft_string=8;
ft_fulltext=9;
ft_datetime=10;
// for ContentGetValue
ft_nosuchfield=-1;
ft_fileerror=-2;
ft_fieldempty=-3;
ft_ondemand=-4;
ft_delayed=0;
// for ContentSetValue
ft_setsuccess=0;
setflags_first_attribute=1; {First attribute of this file}
setflags_last_attribute=2;
setflags_only_date=4;
CONTENT_DELAYIFSLOW=1; // ContentGetValue called in foreground
type tContentDefaultParamStruct=record
size,
PluginInterfaceVersionLow,
PluginInterfaceVersionHi:longint;
DefaultIniName:array[0..MAX_PATH-1] of char;
end;
pContentDefaultParamStruct=^tContentDefaultParamStruct;
type tdateformat=record
wYear,wMonth,wDay:word;
end;
pdateformat=^tdateformat;
type ttimeformat=record
wHour,wMinute,wSecond:word;
end;
ptimeformat=^ttimeformat;
{ Function prototypes: }
{
procedure FsContentGetDetectString(DetectString:pchar;maxlen:integer); stdcall;
function FsContentGetSupportedField(FieldIndex:integer;FieldName:pchar;
Units:pchar;maxlen:integer):integer; stdcall;
function FsContentGetValue(FileName:pchar;FieldIndex,UnitIndex:integer;FieldValue:pbyte;
maxlen,flags:integer):integer; stdcall;
procedure FsContentSetDefaultParams(dps:pContentDefaultParamStruct); stdcall;
procedure FsContentStopGetValue(FileName:pchar); stdcall;
function FsContentGetDefaultSortOrder(FieldIndex:integer):integer; stdcall;
function FsContentGetSupportedFieldFlags(FieldIndex:integer):integer; stdcall;
function FsContentSetValue(FileName:pchar;FieldIndex,UnitIndex,FieldType:integer;
FieldValue:pbyte;flags:integer):integer; stdcall;
function FsContentGetDefaultView(ViewContents,ViewHeaders,ViewWidths,
ViewOptions:pchar;maxlen:integer):bool; stdcall;
}
implementation
end.

View file

@ -1,4 +1,4 @@
unit udsxplugin;
unit DsxPlugin;
interface

View file

@ -1,7 +1,7 @@
{ Contents of file wcxhead.pas }
{ It contains definitions of error codes, flags and callbacks }
unit uWCXhead;
unit WcxPlugin;
interface
uses

View file

@ -1,4 +1,4 @@
unit ucontplugin; { Contents of file contplug.pas }
unit WdxPlugin; { Content plugins }
interface

View file

@ -1,4 +1,4 @@
unit ufsplugin; {Plugin definitions version 1.5}
unit WfxPlugin; {Plugin definitions version 1.5}
interface

View file

@ -3,7 +3,7 @@
// Lister API Guide, which can be found at http://ghisler.com.
// Version: 1.8.
unit WLXPlugin;
unit WlxPlugin;
interface

File diff suppressed because it is too large Load diff

View file

@ -77,7 +77,7 @@ type
implementation
uses
uWCXhead, uGlobs, uDCUtils, uFileSourceOperation,
WcxPlugin, uGlobs, uDCUtils, uFileSourceOperation,
uOperationsManager, fFileOpDlg;
function ShowPackDlg(const SourceFileSource: TFileSource;

View file

@ -1,332 +1,332 @@
{
Double commander
-------------------------------------------------------------------------
Plugin tweak window
Copyright (C) 2008 Koblov Alexander (Alexx2000@mail.ru)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
}
unit fTweakPlugin;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls, uTypes, uWCXModule;
type
{ TfrmTweakPlugin }
TfrmTweakPlugin = class(TForm)
btnAdd: TButton;
btnCancel: TButton;
btnChange: TButton;
btnDefault: TButton;
btnOK: TButton;
btnRemove: TButton;
cbExt: TComboBox;
cbPK_CAPS_BY_CONTENT: TCheckBox;
cbPK_CAPS_DELETE: TCheckBox;
cbPK_CAPS_ENCRYPT: TCheckBox;
cbPK_CAPS_HIDE: TCheckBox;
cbPK_CAPS_MEMPACK: TCheckBox;
cbPK_CAPS_MODIFY: TCheckBox;
cbPK_CAPS_MULTIPLE: TCheckBox;
cbPK_CAPS_NEW: TCheckBox;
cbPK_CAPS_OPTIONS: TCheckBox;
cbPK_CAPS_SEARCHTEXT: TCheckBox;
edtDescription: TEdit;
edtDetectStr: TEdit;
edtName: TEdit;
edtPlugin: TEdit;
grpTweakOther: TGroupBox;
lblDescription: TLabel;
lblDetectStr: TLabel;
lblName: TLabel;
lblExtension: TLabel;
lblFlags: TLabel;
lblFlagsValue: TLabel;
lblPlugin1: TLabel;
lblPackerPlugin: TLabel;
lblPlugin: TLabel;
edtPlugin1: TEdit;
nbTweakAll: TNotebook;
pgTweakPacker: TPage;
pgTweakOther: TPage;
grpTweak: TGroupBox;
procedure btnAddClick(Sender: TObject);
procedure btnChangeClick(Sender: TObject);
procedure btnDefaultClick(Sender: TObject);
procedure btnRemoveClick(Sender: TObject);
procedure cbExtChange(Sender: TObject);
private
FWCXPlugins: TWCXModuleList;
iPrevIndex: Integer;
function GetDefaultFlags(PluginFileName: String): PtrInt;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
end;
function ShowTweakPluginDlg(PluginType: TPluginType; PluginIndex: Integer): Boolean;
implementation
uses
fOptions, uWCXHead, uDCUtils, uLng;
function ShowTweakPluginDlg(PluginType: TPluginType; PluginIndex: Integer): Boolean;
var
I, iIndex: Integer;
begin
with TfrmTweakPlugin.Create(Application) do
try
case PluginType of
ptDSX:
begin
nbTweakAll.PageIndex:= 1;
edtPlugin1.Text:= tmpDSXPlugins.GetDsxModule(PluginIndex).FileName;
edtDescription.Text:= tmpDSXPlugins.GetDsxModule(PluginIndex).Descr;
edtName.Text:= tmpDSXPlugins.GetDsxModule(PluginIndex).Name;
lblDetectStr.Visible:= False;
edtDetectStr.Visible:= False;
end;
ptWCX:
begin
nbTweakAll.PageIndex:= 0;
FWCXPlugins:= TWCXModuleList.Create;
FWCXPlugins.Assign(tmpWCXPlugins);
edtPlugin.Text:= FWCXPlugins.FileName[PluginIndex];
for I:= 0 to FWCXPlugins.Count - 1 do
if FWCXPlugins.FileName[I] = edtPlugin.Text then
cbExt.Items.AddObject(FWCXPlugins.Ext[I], TObject(FWCXPlugins.Flags[I]));
iPrevIndex:= -1;
cbExt.ItemIndex:= 0;
cbExtChange(cbExt);
btnRemove.Enabled:= (cbExt.Items.Count > 1);
end;
ptWDX:
begin
nbTweakAll.PageIndex:= 1;
edtPlugin1.Text:= tmpWDXPlugins.GetWdxModule(PluginIndex).FileName;
edtDetectStr.Text:= tmpWDXPlugins.GetWdxModule(PluginIndex).DetectStr;
edtName.Text:= tmpWDXPlugins.GetWdxModule(PluginIndex).Name;
lblDescription.Visible:= False;
edtDescription.Visible:= False;
end;
ptWFX:
begin
nbTweakAll.PageIndex:= 1;
edtPlugin1.Text:= tmpWFXPlugins.FileName[PluginIndex];
edtName.Text:= tmpWFXPlugins.Name[PluginIndex];
lblDetectStr.Visible:= False;
edtDetectStr.Visible:= False;
lblDescription.Visible:= False;
edtDescription.Visible:= False;
end;
ptWLX:
begin
nbTweakAll.PageIndex:= 1;
edtPlugin1.Text:= tmpWLXPlugins.GetWlxModule(PluginIndex).FileName;
edtDetectStr.Text:= tmpWLXPlugins.GetWlxModule(PluginIndex).DetectStr;
edtName.Text:= tmpWLXPlugins.GetWlxModule(PluginIndex).Name;
lblDescription.Visible:= False;
edtDescription.Visible:= False;
end;
end;
Result:= (ShowModal = mrOK);
if Result then
case PluginType of
ptDSX:
begin
tmpDSXPlugins.GetDsxModule(PluginIndex).FileName:= edtPlugin1.Text;
tmpDSXPlugins.GetDsxModule(PluginIndex).Descr := edtDescription.Text;
tmpDSXPlugins.GetDsxModule(PluginIndex).Name:= edtName.Text;
end;
ptWCX:
begin
for I:= 0 to cbExt.Items.Count - 1 do
begin
iIndex:= FWCXPlugins.IndexOfName(cbExt.Items[I]);
if iIndex >= 0 then
begin
FWCXPlugins.FileName[iIndex]:= edtPlugin.Text;
FWCXPlugins.Flags[iIndex]:= PtrInt(cbExt.Items.Objects[I]);
end;
end;
tmpWCXPlugins.Assign(FWCXPlugins);
end;
ptWDX:
begin
tmpWDXPlugins.GetWdxModule(PluginIndex).FileName:= edtPlugin1.Text;
tmpWDXPlugins.GetWdxModule(PluginIndex).DetectStr:= edtDetectStr.Text;
tmpWDXPlugins.GetWdxModule(PluginIndex).Name:= edtName.Text;
end;
ptWFX:
begin
tmpWFXPlugins.FileName[PluginIndex]:= edtPlugin1.Text;
tmpWFXPlugins.Name[PluginIndex]:= edtName.Text;
end;
ptWLX:
begin
tmpWLXPlugins.GetWlxModule(PluginIndex).FileName:= edtPlugin1.Text;
tmpWLXPlugins.GetWlxModule(PluginIndex).DetectStr:= edtDetectStr.Text;
tmpWLXPlugins.GetWlxModule(PluginIndex).Name:= edtName.Text;
end;
end;
finally
Free;
end;
end;
{ TfrmTweakPlugin }
constructor TfrmTweakPlugin.Create(TheOwner: TComponent);
begin
FWCXPlugins := nil;
iPrevIndex := -1;
inherited;
end;
destructor TfrmTweakPlugin.Destroy;
begin
inherited;
if Assigned(FWCXPlugins) then
FreeAndNil(FWCXPlugins);
end;
procedure TfrmTweakPlugin.cbExtChange(Sender: TObject);
var
iFlags: PtrInt;
begin
if iPrevIndex >= 0 then // save new flags
begin
iFlags:= 0;
if cbPK_CAPS_NEW.Checked then
iFlags:= iFlags or PK_CAPS_NEW;
if cbPK_CAPS_MODIFY.Checked then
iFlags:= iFlags or PK_CAPS_MODIFY;
if cbPK_CAPS_MULTIPLE.Checked then
iFlags:= iFlags or PK_CAPS_MULTIPLE;
if cbPK_CAPS_DELETE.Checked then
iFlags:= iFlags or PK_CAPS_DELETE;
if cbPK_CAPS_OPTIONS.Checked then
iFlags:= iFlags or PK_CAPS_OPTIONS;
if cbPK_CAPS_MEMPACK.Checked then
iFlags:= iFlags or PK_CAPS_MEMPACK;
if cbPK_CAPS_BY_CONTENT.Checked then
iFlags:= iFlags or PK_CAPS_BY_CONTENT;
if cbPK_CAPS_SEARCHTEXT.Checked then
iFlags:= iFlags or PK_CAPS_SEARCHTEXT;
if cbPK_CAPS_HIDE.Checked then
iFlags:= iFlags or PK_CAPS_HIDE;
if cbPK_CAPS_ENCRYPT.Checked then
iFlags:= iFlags or PK_CAPS_ENCRYPT;
cbExt.Items.Objects[iPrevIndex]:= TObject(iFlags);
end;
iPrevIndex:= cbExt.ItemIndex;
iFlags:= PtrInt(cbExt.Items.Objects[cbExt.ItemIndex]);
lblFlagsValue.Caption:= '('+IntToStr(iFlags)+')';
cbPK_CAPS_NEW.Checked:= Boolean(iFlags and PK_CAPS_NEW);
cbPK_CAPS_MODIFY.Checked:= Boolean(iFlags and PK_CAPS_MODIFY);
cbPK_CAPS_MULTIPLE.Checked:= Boolean(iFlags and PK_CAPS_MULTIPLE);
cbPK_CAPS_DELETE.Checked:= Boolean(iFlags and PK_CAPS_DELETE);
cbPK_CAPS_OPTIONS.Checked:= Boolean(iFlags and PK_CAPS_OPTIONS);
cbPK_CAPS_MEMPACK.Checked:= Boolean(iFlags and PK_CAPS_MEMPACK);
cbPK_CAPS_BY_CONTENT.Checked:= Boolean(iFlags and PK_CAPS_BY_CONTENT);
cbPK_CAPS_SEARCHTEXT.Checked:= Boolean(iFlags and PK_CAPS_SEARCHTEXT);
cbPK_CAPS_HIDE.Checked:= Boolean(iFlags and PK_CAPS_HIDE);
cbPK_CAPS_ENCRYPT.Checked:= Boolean(iFlags and PK_CAPS_ENCRYPT);
end;
procedure TfrmTweakPlugin.btnDefaultClick(Sender: TObject);
begin
cbExt.Items.Objects[cbExt.ItemIndex]:= TObject(GetDefaultFlags(edtPlugin.Text));
iPrevIndex:= -1;
cbExtChange(cbExt);
end;
procedure TfrmTweakPlugin.btnRemoveClick(Sender: TObject);
var
I, OldIndex: Integer;
begin
iPrevIndex:= -1; // Must be before cbExt.Items.Delete, because it may trigger cbExtChange.
OldIndex := cbExt.ItemIndex;
I:= FWCXPlugins.IndexOfName(cbExt.Text);
FWCXPlugins.Delete(I);
cbExt.Items.Delete(cbExt.ItemIndex);
if OldIndex >= cbExt.Items.Count then
OldIndex := OldIndex - 1;
cbExt.ItemIndex := OldIndex;
if iPrevIndex = -1 then // Call only if not already triggerred.
cbExtChange(cbExt);
btnRemove.Enabled:= (cbExt.Items.Count > 1);
end;
procedure TfrmTweakPlugin.btnAddClick(Sender: TObject);
var
sExt: String;
iFlags: PtrInt;
begin
if InputQuery(rsOptEnterExt,Format(rsOptAssocPluginWith, [GetCmdDirFromEnvVar(edtPlugin.Text)]), sExt) then
begin
iFlags:= GetDefaultFlags(edtPlugin.Text);
cbExt.ItemIndex:= cbExt.Items.AddObject(sExt, TObject(iFlags));
FWCXPlugins.Add(cbExt.Items[cbExt.ItemIndex], iFlags, edtPlugin.Text);
iPrevIndex:= -1;
cbExtChange(cbExt);
end;
end;
procedure TfrmTweakPlugin.btnChangeClick(Sender: TObject);
var
I: Integer;
sExt: String;
begin
sExt:= cbExt.Items[cbExt.ItemIndex];
I:= FWCXPlugins.IndexOfName(sExt);
if InputQuery(rsOptEnterExt,Format(rsOptAssocPluginWith, [GetCmdDirFromEnvVar(edtPlugin.Text)]), sExt) then
begin
FWCXPlugins.Ext[I]:= sExt;
cbExt.Items[cbExt.ItemIndex]:= sExt;
end;
end;
function TfrmTweakPlugin.GetDefaultFlags(PluginFileName: String): PtrInt;
var
WCXmodule: TWCXmodule;
begin
Result:= 0;
WCXmodule := TWCXmodule.Create;
if WCXmodule.LoadModule(GetCmdDirFromEnvVar(PluginFileName)) then
begin
Result:= WCXmodule.VFSMisc;
WCXModule.UnloadModule;
end;
WCXmodule.Free;
end;
initialization
{$I ftweakplugin.lrs}
end.
{
Double commander
-------------------------------------------------------------------------
Plugin tweak window
Copyright (C) 2008 Koblov Alexander (Alexx2000@mail.ru)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
}
unit fTweakPlugin;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls, uTypes, uWCXModule;
type
{ TfrmTweakPlugin }
TfrmTweakPlugin = class(TForm)
btnAdd: TButton;
btnCancel: TButton;
btnChange: TButton;
btnDefault: TButton;
btnOK: TButton;
btnRemove: TButton;
cbExt: TComboBox;
cbPK_CAPS_BY_CONTENT: TCheckBox;
cbPK_CAPS_DELETE: TCheckBox;
cbPK_CAPS_ENCRYPT: TCheckBox;
cbPK_CAPS_HIDE: TCheckBox;
cbPK_CAPS_MEMPACK: TCheckBox;
cbPK_CAPS_MODIFY: TCheckBox;
cbPK_CAPS_MULTIPLE: TCheckBox;
cbPK_CAPS_NEW: TCheckBox;
cbPK_CAPS_OPTIONS: TCheckBox;
cbPK_CAPS_SEARCHTEXT: TCheckBox;
edtDescription: TEdit;
edtDetectStr: TEdit;
edtName: TEdit;
edtPlugin: TEdit;
grpTweakOther: TGroupBox;
lblDescription: TLabel;
lblDetectStr: TLabel;
lblName: TLabel;
lblExtension: TLabel;
lblFlags: TLabel;
lblFlagsValue: TLabel;
lblPlugin1: TLabel;
lblPackerPlugin: TLabel;
lblPlugin: TLabel;
edtPlugin1: TEdit;
nbTweakAll: TNotebook;
pgTweakPacker: TPage;
pgTweakOther: TPage;
grpTweak: TGroupBox;
procedure btnAddClick(Sender: TObject);
procedure btnChangeClick(Sender: TObject);
procedure btnDefaultClick(Sender: TObject);
procedure btnRemoveClick(Sender: TObject);
procedure cbExtChange(Sender: TObject);
private
FWCXPlugins: TWCXModuleList;
iPrevIndex: Integer;
function GetDefaultFlags(PluginFileName: String): PtrInt;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
end;
function ShowTweakPluginDlg(PluginType: TPluginType; PluginIndex: Integer): Boolean;
implementation
uses
fOptions, WcxPlugin, uDCUtils, uLng;
function ShowTweakPluginDlg(PluginType: TPluginType; PluginIndex: Integer): Boolean;
var
I, iIndex: Integer;
begin
with TfrmTweakPlugin.Create(Application) do
try
case PluginType of
ptDSX:
begin
nbTweakAll.PageIndex:= 1;
edtPlugin1.Text:= tmpDSXPlugins.GetDsxModule(PluginIndex).FileName;
edtDescription.Text:= tmpDSXPlugins.GetDsxModule(PluginIndex).Descr;
edtName.Text:= tmpDSXPlugins.GetDsxModule(PluginIndex).Name;
lblDetectStr.Visible:= False;
edtDetectStr.Visible:= False;
end;
ptWCX:
begin
nbTweakAll.PageIndex:= 0;
FWCXPlugins:= TWCXModuleList.Create;
FWCXPlugins.Assign(tmpWCXPlugins);
edtPlugin.Text:= FWCXPlugins.FileName[PluginIndex];
for I:= 0 to FWCXPlugins.Count - 1 do
if FWCXPlugins.FileName[I] = edtPlugin.Text then
cbExt.Items.AddObject(FWCXPlugins.Ext[I], TObject(FWCXPlugins.Flags[I]));
iPrevIndex:= -1;
cbExt.ItemIndex:= 0;
cbExtChange(cbExt);
btnRemove.Enabled:= (cbExt.Items.Count > 1);
end;
ptWDX:
begin
nbTweakAll.PageIndex:= 1;
edtPlugin1.Text:= tmpWDXPlugins.GetWdxModule(PluginIndex).FileName;
edtDetectStr.Text:= tmpWDXPlugins.GetWdxModule(PluginIndex).DetectStr;
edtName.Text:= tmpWDXPlugins.GetWdxModule(PluginIndex).Name;
lblDescription.Visible:= False;
edtDescription.Visible:= False;
end;
ptWFX:
begin
nbTweakAll.PageIndex:= 1;
edtPlugin1.Text:= tmpWFXPlugins.FileName[PluginIndex];
edtName.Text:= tmpWFXPlugins.Name[PluginIndex];
lblDetectStr.Visible:= False;
edtDetectStr.Visible:= False;
lblDescription.Visible:= False;
edtDescription.Visible:= False;
end;
ptWLX:
begin
nbTweakAll.PageIndex:= 1;
edtPlugin1.Text:= tmpWLXPlugins.GetWlxModule(PluginIndex).FileName;
edtDetectStr.Text:= tmpWLXPlugins.GetWlxModule(PluginIndex).DetectStr;
edtName.Text:= tmpWLXPlugins.GetWlxModule(PluginIndex).Name;
lblDescription.Visible:= False;
edtDescription.Visible:= False;
end;
end;
Result:= (ShowModal = mrOK);
if Result then
case PluginType of
ptDSX:
begin
tmpDSXPlugins.GetDsxModule(PluginIndex).FileName:= edtPlugin1.Text;
tmpDSXPlugins.GetDsxModule(PluginIndex).Descr := edtDescription.Text;
tmpDSXPlugins.GetDsxModule(PluginIndex).Name:= edtName.Text;
end;
ptWCX:
begin
for I:= 0 to cbExt.Items.Count - 1 do
begin
iIndex:= FWCXPlugins.IndexOfName(cbExt.Items[I]);
if iIndex >= 0 then
begin
FWCXPlugins.FileName[iIndex]:= edtPlugin.Text;
FWCXPlugins.Flags[iIndex]:= PtrInt(cbExt.Items.Objects[I]);
end;
end;
tmpWCXPlugins.Assign(FWCXPlugins);
end;
ptWDX:
begin
tmpWDXPlugins.GetWdxModule(PluginIndex).FileName:= edtPlugin1.Text;
tmpWDXPlugins.GetWdxModule(PluginIndex).DetectStr:= edtDetectStr.Text;
tmpWDXPlugins.GetWdxModule(PluginIndex).Name:= edtName.Text;
end;
ptWFX:
begin
tmpWFXPlugins.FileName[PluginIndex]:= edtPlugin1.Text;
tmpWFXPlugins.Name[PluginIndex]:= edtName.Text;
end;
ptWLX:
begin
tmpWLXPlugins.GetWlxModule(PluginIndex).FileName:= edtPlugin1.Text;
tmpWLXPlugins.GetWlxModule(PluginIndex).DetectStr:= edtDetectStr.Text;
tmpWLXPlugins.GetWlxModule(PluginIndex).Name:= edtName.Text;
end;
end;
finally
Free;
end;
end;
{ TfrmTweakPlugin }
constructor TfrmTweakPlugin.Create(TheOwner: TComponent);
begin
FWCXPlugins := nil;
iPrevIndex := -1;
inherited;
end;
destructor TfrmTweakPlugin.Destroy;
begin
inherited;
if Assigned(FWCXPlugins) then
FreeAndNil(FWCXPlugins);
end;
procedure TfrmTweakPlugin.cbExtChange(Sender: TObject);
var
iFlags: PtrInt;
begin
if iPrevIndex >= 0 then // save new flags
begin
iFlags:= 0;
if cbPK_CAPS_NEW.Checked then
iFlags:= iFlags or PK_CAPS_NEW;
if cbPK_CAPS_MODIFY.Checked then
iFlags:= iFlags or PK_CAPS_MODIFY;
if cbPK_CAPS_MULTIPLE.Checked then
iFlags:= iFlags or PK_CAPS_MULTIPLE;
if cbPK_CAPS_DELETE.Checked then
iFlags:= iFlags or PK_CAPS_DELETE;
if cbPK_CAPS_OPTIONS.Checked then
iFlags:= iFlags or PK_CAPS_OPTIONS;
if cbPK_CAPS_MEMPACK.Checked then
iFlags:= iFlags or PK_CAPS_MEMPACK;
if cbPK_CAPS_BY_CONTENT.Checked then
iFlags:= iFlags or PK_CAPS_BY_CONTENT;
if cbPK_CAPS_SEARCHTEXT.Checked then
iFlags:= iFlags or PK_CAPS_SEARCHTEXT;
if cbPK_CAPS_HIDE.Checked then
iFlags:= iFlags or PK_CAPS_HIDE;
if cbPK_CAPS_ENCRYPT.Checked then
iFlags:= iFlags or PK_CAPS_ENCRYPT;
cbExt.Items.Objects[iPrevIndex]:= TObject(iFlags);
end;
iPrevIndex:= cbExt.ItemIndex;
iFlags:= PtrInt(cbExt.Items.Objects[cbExt.ItemIndex]);
lblFlagsValue.Caption:= '('+IntToStr(iFlags)+')';
cbPK_CAPS_NEW.Checked:= Boolean(iFlags and PK_CAPS_NEW);
cbPK_CAPS_MODIFY.Checked:= Boolean(iFlags and PK_CAPS_MODIFY);
cbPK_CAPS_MULTIPLE.Checked:= Boolean(iFlags and PK_CAPS_MULTIPLE);
cbPK_CAPS_DELETE.Checked:= Boolean(iFlags and PK_CAPS_DELETE);
cbPK_CAPS_OPTIONS.Checked:= Boolean(iFlags and PK_CAPS_OPTIONS);
cbPK_CAPS_MEMPACK.Checked:= Boolean(iFlags and PK_CAPS_MEMPACK);
cbPK_CAPS_BY_CONTENT.Checked:= Boolean(iFlags and PK_CAPS_BY_CONTENT);
cbPK_CAPS_SEARCHTEXT.Checked:= Boolean(iFlags and PK_CAPS_SEARCHTEXT);
cbPK_CAPS_HIDE.Checked:= Boolean(iFlags and PK_CAPS_HIDE);
cbPK_CAPS_ENCRYPT.Checked:= Boolean(iFlags and PK_CAPS_ENCRYPT);
end;
procedure TfrmTweakPlugin.btnDefaultClick(Sender: TObject);
begin
cbExt.Items.Objects[cbExt.ItemIndex]:= TObject(GetDefaultFlags(edtPlugin.Text));
iPrevIndex:= -1;
cbExtChange(cbExt);
end;
procedure TfrmTweakPlugin.btnRemoveClick(Sender: TObject);
var
I, OldIndex: Integer;
begin
iPrevIndex:= -1; // Must be before cbExt.Items.Delete, because it may trigger cbExtChange.
OldIndex := cbExt.ItemIndex;
I:= FWCXPlugins.IndexOfName(cbExt.Text);
FWCXPlugins.Delete(I);
cbExt.Items.Delete(cbExt.ItemIndex);
if OldIndex >= cbExt.Items.Count then
OldIndex := OldIndex - 1;
cbExt.ItemIndex := OldIndex;
if iPrevIndex = -1 then // Call only if not already triggerred.
cbExtChange(cbExt);
btnRemove.Enabled:= (cbExt.Items.Count > 1);
end;
procedure TfrmTweakPlugin.btnAddClick(Sender: TObject);
var
sExt: String;
iFlags: PtrInt;
begin
if InputQuery(rsOptEnterExt,Format(rsOptAssocPluginWith, [GetCmdDirFromEnvVar(edtPlugin.Text)]), sExt) then
begin
iFlags:= GetDefaultFlags(edtPlugin.Text);
cbExt.ItemIndex:= cbExt.Items.AddObject(sExt, TObject(iFlags));
FWCXPlugins.Add(cbExt.Items[cbExt.ItemIndex], iFlags, edtPlugin.Text);
iPrevIndex:= -1;
cbExtChange(cbExt);
end;
end;
procedure TfrmTweakPlugin.btnChangeClick(Sender: TObject);
var
I: Integer;
sExt: String;
begin
sExt:= cbExt.Items[cbExt.ItemIndex];
I:= FWCXPlugins.IndexOfName(sExt);
if InputQuery(rsOptEnterExt,Format(rsOptAssocPluginWith, [GetCmdDirFromEnvVar(edtPlugin.Text)]), sExt) then
begin
FWCXPlugins.Ext[I]:= sExt;
cbExt.Items[cbExt.ItemIndex]:= sExt;
end;
end;
function TfrmTweakPlugin.GetDefaultFlags(PluginFileName: String): PtrInt;
var
WCXmodule: TWCXmodule;
begin
Result:= 0;
WCXmodule := TWCXmodule.Create;
if WCXmodule.LoadModule(GetCmdDirFromEnvVar(PluginFileName)) then
begin
Result:= WCXmodule.VFSMisc;
WCXModule.UnloadModule;
end;
WCXmodule.Free;
end;
initialization
{$I ftweakplugin.lrs}
end.

View file

@ -46,7 +46,7 @@ type
implementation
uses
LCLProc, FileUtil, uDCUtils, uWCXhead, uWCXmodule, uLng,
LCLProc, FileUtil, uDCUtils, WcxPlugin, uWCXmodule, uLng,
uFileSourceOperationUI, uFileSystemUtil;
// ----------------------------------------------------------------------------

View file

@ -1,492 +1,492 @@
unit uWcxArchiveCopyOutOperation;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, StringHashList, uLog, uGlobs,
uFileSourceCopyOperation,
uFileSource,
uFileSourceOperation,
uFile,
uWcxArchiveFileSource;
type
TWcxArchiveCopyOutOperation = class(TFileSourceCopyOutOperation)
private
FWcxArchiveFileSource: TWcxArchiveFileSource;
FStatistics: TFileSourceCopyOperationStatistics; // local copy of statistics
FCurrentFileSize: Int64;
{en
Creates neccessary paths before extracting files from archive.
Also counts size of all files that will be extracted.
@param(Files
List of files/directories to extract (relative to archive root).)
@param(FileMask
Only directories containing files matching this mask will be created.)
@param(sDestPath
Destination path where the files will be extracted.)
@param(CurrentArchiveDir
Path inside the archive from where the files will be extracted.)
@param(CreatedPaths
This list will be filled with absolute paths to directories
that were created, together with their attributes.)}
procedure CreateDirsAndCountFiles(const theFiles: TFiles; FileMask: String;
sDestPath: String; CurrentArchiveDir: String;
var CreatedPaths: TStringHashList);
{en
Sets attributes for directories.
@param(Paths
The list of absolute paths, which attributes are to be set.
Each list item's data field must be a pointer to THeaderData,
from where the attributes are retrieved.}
function SetDirsAttributes(const Paths: TStringHashList): Boolean;
procedure ShowError(sMessage: String; logOptions: TLogOptions = []);
procedure LogMessage(sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
protected
public
constructor Create(var aSourceFileSource: TFileSource;
var aTargetFileSource: TFileSource;
var theSourceFiles: TFiles;
aTargetPath: String); override;
destructor Destroy; override;
procedure Initialize; override;
procedure MainExecute; override;
procedure Finalize; override;
end;
implementation
uses
LCLProc, Masks, FileUtil, contnrs, uOSUtils, uDCUtils, uWCXhead,
uFileSourceOperationUI, uWCXmodule, uFileProcs, uLng;
// ----------------------------------------------------------------------------
// WCX callbacks
var
// WCX interface cannot discern different operations (for reporting progress),
// so this global variable is used to store currently running operation.
// (There may be other running concurrently, but only one may report progress.)
WcxCopyOutOperation: TWcxArchiveCopyOutOperation; // used in ProcessDataProc
function ChangeVolProc(ArcName : Pchar; Mode:Longint):Longint; stdcall;
begin
{ // Use operation UI for this.
case Mode of
PK_VOL_ASK:
ArcName := PChar(UTF8ToSys(Dialogs.InputBox('Double Commander', rsMsgSelLocNextVol, SysToUTF8(ArcName))));
PK_VOL_NOTIFY:
ShowMessage(rsMsgNextVolUnpack);
end;
}
Result := 0;
end;
function ProcessDataProc(FileName: PChar; Size: Integer): Integer; stdcall;
begin
//DebugLn('Working ' + FileName + ' Size = ' + IntToStr(Size));
Result := 1;
if Assigned(WcxCopyOutOperation) then
begin
if WcxCopyOutOperation.State = fsosStopping then // Cancel operation
Exit(0);
with WcxCopyOutOperation.FStatistics do
begin
if Size >= 0 then
begin
CurrentFileDoneBytes := CurrentFileDoneBytes + Size;
DoneBytes := DoneBytes + Size;
end
else // For plugins which unpack in CloseArchive
begin
if (Size >= -100) and (Size <= -1) then // first percent bar
begin
CurrentFileDoneBytes := CurrentFileTotalBytes * (-Size) div 100;
CurrentFileTotalBytes := 100;
if Size = -100 then // File finished
DoneBytes := DoneBytes + WcxCopyOutOperation.FCurrentFileSize;
//DebugLn('Working ' + FileName + ' Percent1 = ' + IntToStr(FFileOpDlg.iProgress1Pos));
end
else if (Size >= -1100) and (Size <= -1000) then // second percent bar
begin
DoneBytes := TotalBytes * Int64(-Size - 1000) div 100;
//DebugLn('Working ' + FileName + ' Percent2 = ' + IntToStr(FFileOpDlg.iProgress2Pos));
end
else
begin
DoneBytes := DoneBytes + WcxCopyOutOperation.FCurrentFileSize;
end;
end;
WcxCopyOutOperation.UpdateStatistics(WcxCopyOutOperation.FStatistics);
end;
end;
end;
// ----------------------------------------------------------------------------
constructor TWcxArchiveCopyOutOperation.Create(var aSourceFileSource: TFileSource;
var aTargetFileSource: TFileSource;
var theSourceFiles: TFiles;
aTargetPath: String);
begin
FWcxArchiveFileSource := aSourceFileSource as TWcxArchiveFileSource;
inherited Create(aSourceFileSource, aTargetFileSource, theSourceFiles, aTargetPath);
end;
destructor TWcxArchiveCopyOutOperation.Destroy;
begin
WcxCopyOutOperation := nil; // clear global variable pointing to self
inherited Destroy;
end;
procedure TWcxArchiveCopyOutOperation.Initialize;
begin
if Assigned(WcxCopyOutOperation) then
raise Exception.Create('Another WCX copy operation is already running');
WcxCopyOutOperation := Self;
// Get initialized statistics; then we change only what is needed.
FStatistics := RetrieveStatistics;
end;
procedure TWcxArchiveCopyOutOperation.MainExecute; //Flags: Integer
var
ArcHandle: TArcHandle;
Header: TWCXHeader;
TargetFileName: String;
FileMask: String;
CreatedPaths: TStringHashList;
OpenResult: Longint;
iResult: Integer;
Files: TFiles = nil;
WcxModule: TWcxModule;
begin
WcxModule := FWcxArchiveFileSource.WcxModule;
ArcHandle := WcxModule.OpenArchiveHandle(FWcxArchiveFileSource.ArchiveFileName,
PK_OM_EXTRACT,
OpenResult);
if ArcHandle = 0 then
begin
AskQuestion(uWcxModule.GetErrorMsg(OpenResult), '', [fsourOk], fsourOk, fsourOk);
RaiseAbortOperation;
end;
FileMask := ExtractFileName(TargetPath);
if FileMask = '' then FileMask := '*'; // extract all selected files/folders
// Convert file list so that filenames are relative to archive root.
Files := SourceFiles.Clone;
ChangeFileListRoot(PathDelim, Files);
CreatedPaths := TStringHashList.Create(True);
try
// Count total files size and create needed directories.
CreateDirsAndCountFiles(Files, FileMask,
TargetPath, Files.Path,
CreatedPaths);
WcxModule.SetChangeVolProc(ArcHandle, @ChangeVolProc);
WcxModule.SetProcessDataProc(ArcHandle, @ProcessDataProc);
while (WcxModule.ReadWCXHeader(ArcHandle, Header) = E_SUCCESS) do
try
CheckOperationState;
// Now check if the file is to be extracted.
if (not FPS_ISDIR(Header.FileAttr)) // Omit directories (we handle them ourselves).
and MatchesFileList(Files, Header.FileName) // Check if it's included in the filelist
and ((FileMask = '*.*') or (FileMask = '*') // And name matches file mask
or MatchesMaskList(ExtractFileName(Header.FileName), FileMask))
then
begin
TargetFileName := TargetPath + ExtractDirLevel(Files.Path, Header.FileName);
with FStatistics do
begin
CurrentFileFrom := Header.FileName;
CurrentFileTo := TargetFileName;
CurrentFileTotalBytes := Header.UnpSize;
CurrentFileDoneBytes := 0;
UpdateStatistics(FStatistics);
FCurrentFileSize := Header.UnpSize;
end;
iResult := WcxModule.ProcessFile(ArcHandle, PK_EXTRACT, nil, PAnsiChar(UTF8ToSys(TargetFileName)));
if iResult <> E_SUCCESS then
begin
ShowError(Format(rsMsgLogError + rsMsgLogExtract,
[FWcxArchiveFileSource.ArchiveFileName + PathDelim +
Header.FileName + ' -> ' + TargetFileName +
' - ' + GetErrorMsg(iResult)]), [log_arc_op]);
// User aborted operation.
if iResult = E_EABORTED then
Break;
end // Error
else
begin
LogMessage(Format(rsMsgLogSuccess + rsMsgLogExtract,
[FWcxArchiveFileSource.ArchiveFileName + PathDelim +
Header.FileName +' -> ' + TargetFileName]), [log_arc_op], lmtSuccess);
end; // Success
end // Extract
else // Skip
begin
iResult := WcxModule.ProcessFile(ArcHandle, PK_SKIP, nil, nil);
//Check for errors
if iResult <> E_SUCCESS then
begin
ShowError(Format(rsMsgLogError + rsMsgLogExtract,
[FWcxArchiveFileSource.ArchiveFileName + PathDelim +
Header.FileName + ' -> ' + TargetFileName +
' - ' + GetErrorMsg(iResult)]), [log_arc_op]);
end;
end; // Skip
finally
FreeAndNil(Header);
end;
WcxModule.CloseArchive(ArcHandle);
SetDirsAttributes(CreatedPaths);
finally
if Assigned(Files) then
FreeAndNil(Files);
FreeAndNil(CreatedPaths);
end;
end;
procedure TWcxArchiveCopyOutOperation.Finalize;
begin
WcxCopyOutOperation := nil;
end;
procedure TWcxArchiveCopyOutOperation.CreateDirsAndCountFiles(
const theFiles: TFiles; FileMask: String;
sDestPath: String; CurrentArchiveDir: String;
var CreatedPaths: TStringHashList);
var
// List of paths that we know must be created.
PathsToCreate: TStringHashList;
// List of possible directories to create with their attributes.
// This hash list is created to speed up searches for attributes in archive file list.
DirsAttributes: TStringHashList;
i: Integer;
CurrentFileName: String;
Header: TWCXHeader;
Directories: TStringList;
PathIndex: Integer;
ListIndex: Integer;
TargetDir: String;
FileList: TObjectList;
begin
FileList := FWcxArchiveFileSource.ArchiveFileList;
{ First, collect all the paths that need to be created and their attributes. }
PathsToCreate := TStringHashList.Create(True);
DirsAttributes := TStringHashList.Create(True);
for i := 0 to FileList.Count - 1 do
begin
Header := TWCXHeader(FileList.Items[i]);
// Check if the file from the archive fits the selection given via SourceFiles.
if not MatchesFileList(theFiles, Header.FileName) then
Continue;
if FPS_ISDIR(Header.FileAttr) then
begin
CurrentFileName := ExtractDirLevel(CurrentArchiveDir, Header.FileName);
// Save this directory and a pointer to its entry.
DirsAttributes.Add(CurrentFileName, Header);
// If extracting all files and directories, add this directory
// to PathsToCreate so that empty directories are also created.
if (FileMask = '*.*') or (FileMask = '*') then
begin
// Paths in PathsToCreate list must end with path delimiter.
CurrentFileName := IncludeTrailingPathDelimiter(CurrentFileName);
if PathsToCreate.Find(CurrentFileName) < 0 then
PathsToCreate.Add(CurrentFileName);
end;
end
else
begin
if ((FileMask = '*.*') or (FileMask = '*') or
MatchesMaskList(ExtractFileName(Header.FileName), FileMask)) then
begin
Inc(FStatistics.TotalBytes, Header.UnpSize);
Inc(FStatistics.TotalFiles, 1);
CurrentFileName := ExtractDirLevel(CurrentArchiveDir, ExtractFilePath(Header.FileName));
// If CurrentFileName is empty now then it was a file in current archive
// directory, therefore we don't have to create any paths for it.
if Length(CurrentFileName) > 0 then
if PathsToCreate.Find(CurrentFileName) < 0 then
PathsToCreate.Add(CurrentFileName);
end;
end;
end;
{ Second, create paths and save which paths were created and their attributes. }
Directories := TStringList.Create;
try
sDestPath := IncludeTrailingPathDelimiter(sDestPath);
// Create path to destination directory (we don't have attributes for that).
mbForceDirectory(sDestPath);
CreatedPaths.Clear;
for PathIndex := 0 to PathsToCreate.Count - 1 do
begin
Directories.Clear;
// Create also all parent directories of the path to create.
// This adds directories to list in order from the outer to inner ones,
// for example: dir, dir/dir2, dir/dir2/dir3.
if GetDirs(PathsToCreate.List[PathIndex]^.Key, Directories) <> -1 then
try
for i := 0 to Directories.Count - 1 do
begin
TargetDir := sDestPath + Directories.Strings[i];
if (CreatedPaths.Find(TargetDir) = -1) and
(not DirPathExists(TargetDir)) then
begin
if mbForceDirectory(TargetDir) = False then
begin
// Error, cannot create directory.
Break; // Don't try to create subdirectories.
end
else
begin
// Retrieve attributes for this directory, if they are stored.
ListIndex := DirsAttributes.Find(Directories.Strings[i]);
if ListIndex <> -1 then
Header := TWcxHeader(DirsAttributes.List[ListIndex]^.Data)
else
Header := nil;
CreatedPaths.Add(TargetDir, Header);
end;
end;
end;
except
end;
end;
finally
FreeAndNil(PathsToCreate);
FreeAndNil(DirsAttributes);
FreeAndNil(Directories);
end;
end;
function TWcxArchiveCopyOutOperation.SetDirsAttributes(const Paths: TStringHashList): Boolean;
var
PathIndex: Integer;
TargetDir: String;
Header: TWCXHeader;
Time: Longint;
begin
Result := True;
for PathIndex := 0 to Paths.Count - 1 do
begin
// Get attributes.
Header := TWCXHeader(Paths.List[PathIndex]^.Data);
if Assigned(Header) then
begin
TargetDir := Paths.List[PathIndex]^.Key;
try
{$IF DEFINED(MSWINDOWS)}
// Restore attributes, e.g., hidden, read-only.
// On Unix attributes value would have to be translated somehow.
mbFileSetAttr(TargetDir, Header.FileAttr);
{$ENDIF}
Time := Header.FileTime;
// Set creation, modification time
mbFileSetTime(TargetDir, Time, Time, Time);
except
Result := False;
end;
end;
end;
end;
procedure TWcxArchiveCopyOutOperation.ShowError(sMessage: String; logOptions: TLogOptions);
begin
if not gSkipFileOpError then
begin
if AskQuestion(sMessage, '', [fsourSkip, fsourCancel],
fsourSkip, fsourAbort) = fsourAbort then
begin
RaiseAbortOperation;
end;
end
else
begin
LogMessage(sMessage, logOptions, lmtError);
end;
end;
procedure TWcxArchiveCopyOutOperation.LogMessage(sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
begin
case logMsgType of
lmtError:
if not (log_errors in gLogOptions) then Exit;
lmtInfo:
if not (log_info in gLogOptions) then Exit;
lmtSuccess:
if not (log_success in gLogOptions) then Exit;
end;
if logOptions <= gLogOptions then
begin
logWrite(Thread, sMessage, logMsgType);
end;
end;
end.
unit uWcxArchiveCopyOutOperation;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, StringHashList, uLog, uGlobs,
uFileSourceCopyOperation,
uFileSource,
uFileSourceOperation,
uFile,
uWcxArchiveFileSource;
type
TWcxArchiveCopyOutOperation = class(TFileSourceCopyOutOperation)
private
FWcxArchiveFileSource: TWcxArchiveFileSource;
FStatistics: TFileSourceCopyOperationStatistics; // local copy of statistics
FCurrentFileSize: Int64;
{en
Creates neccessary paths before extracting files from archive.
Also counts size of all files that will be extracted.
@param(Files
List of files/directories to extract (relative to archive root).)
@param(FileMask
Only directories containing files matching this mask will be created.)
@param(sDestPath
Destination path where the files will be extracted.)
@param(CurrentArchiveDir
Path inside the archive from where the files will be extracted.)
@param(CreatedPaths
This list will be filled with absolute paths to directories
that were created, together with their attributes.)}
procedure CreateDirsAndCountFiles(const theFiles: TFiles; FileMask: String;
sDestPath: String; CurrentArchiveDir: String;
var CreatedPaths: TStringHashList);
{en
Sets attributes for directories.
@param(Paths
The list of absolute paths, which attributes are to be set.
Each list item's data field must be a pointer to THeaderData,
from where the attributes are retrieved.}
function SetDirsAttributes(const Paths: TStringHashList): Boolean;
procedure ShowError(sMessage: String; logOptions: TLogOptions = []);
procedure LogMessage(sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
protected
public
constructor Create(var aSourceFileSource: TFileSource;
var aTargetFileSource: TFileSource;
var theSourceFiles: TFiles;
aTargetPath: String); override;
destructor Destroy; override;
procedure Initialize; override;
procedure MainExecute; override;
procedure Finalize; override;
end;
implementation
uses
LCLProc, Masks, FileUtil, contnrs, uOSUtils, uDCUtils, WcxPlugin,
uFileSourceOperationUI, uWCXmodule, uFileProcs, uLng;
// ----------------------------------------------------------------------------
// WCX callbacks
var
// WCX interface cannot discern different operations (for reporting progress),
// so this global variable is used to store currently running operation.
// (There may be other running concurrently, but only one may report progress.)
WcxCopyOutOperation: TWcxArchiveCopyOutOperation; // used in ProcessDataProc
function ChangeVolProc(ArcName : Pchar; Mode:Longint):Longint; stdcall;
begin
{ // Use operation UI for this.
case Mode of
PK_VOL_ASK:
ArcName := PChar(UTF8ToSys(Dialogs.InputBox('Double Commander', rsMsgSelLocNextVol, SysToUTF8(ArcName))));
PK_VOL_NOTIFY:
ShowMessage(rsMsgNextVolUnpack);
end;
}
Result := 0;
end;
function ProcessDataProc(FileName: PChar; Size: Integer): Integer; stdcall;
begin
//DebugLn('Working ' + FileName + ' Size = ' + IntToStr(Size));
Result := 1;
if Assigned(WcxCopyOutOperation) then
begin
if WcxCopyOutOperation.State = fsosStopping then // Cancel operation
Exit(0);
with WcxCopyOutOperation.FStatistics do
begin
if Size >= 0 then
begin
CurrentFileDoneBytes := CurrentFileDoneBytes + Size;
DoneBytes := DoneBytes + Size;
end
else // For plugins which unpack in CloseArchive
begin
if (Size >= -100) and (Size <= -1) then // first percent bar
begin
CurrentFileDoneBytes := CurrentFileTotalBytes * (-Size) div 100;
CurrentFileTotalBytes := 100;
if Size = -100 then // File finished
DoneBytes := DoneBytes + WcxCopyOutOperation.FCurrentFileSize;
//DebugLn('Working ' + FileName + ' Percent1 = ' + IntToStr(FFileOpDlg.iProgress1Pos));
end
else if (Size >= -1100) and (Size <= -1000) then // second percent bar
begin
DoneBytes := TotalBytes * Int64(-Size - 1000) div 100;
//DebugLn('Working ' + FileName + ' Percent2 = ' + IntToStr(FFileOpDlg.iProgress2Pos));
end
else
begin
DoneBytes := DoneBytes + WcxCopyOutOperation.FCurrentFileSize;
end;
end;
WcxCopyOutOperation.UpdateStatistics(WcxCopyOutOperation.FStatistics);
end;
end;
end;
// ----------------------------------------------------------------------------
constructor TWcxArchiveCopyOutOperation.Create(var aSourceFileSource: TFileSource;
var aTargetFileSource: TFileSource;
var theSourceFiles: TFiles;
aTargetPath: String);
begin
FWcxArchiveFileSource := aSourceFileSource as TWcxArchiveFileSource;
inherited Create(aSourceFileSource, aTargetFileSource, theSourceFiles, aTargetPath);
end;
destructor TWcxArchiveCopyOutOperation.Destroy;
begin
WcxCopyOutOperation := nil; // clear global variable pointing to self
inherited Destroy;
end;
procedure TWcxArchiveCopyOutOperation.Initialize;
begin
if Assigned(WcxCopyOutOperation) then
raise Exception.Create('Another WCX copy operation is already running');
WcxCopyOutOperation := Self;
// Get initialized statistics; then we change only what is needed.
FStatistics := RetrieveStatistics;
end;
procedure TWcxArchiveCopyOutOperation.MainExecute; //Flags: Integer
var
ArcHandle: TArcHandle;
Header: TWCXHeader;
TargetFileName: String;
FileMask: String;
CreatedPaths: TStringHashList;
OpenResult: Longint;
iResult: Integer;
Files: TFiles = nil;
WcxModule: TWcxModule;
begin
WcxModule := FWcxArchiveFileSource.WcxModule;
ArcHandle := WcxModule.OpenArchiveHandle(FWcxArchiveFileSource.ArchiveFileName,
PK_OM_EXTRACT,
OpenResult);
if ArcHandle = 0 then
begin
AskQuestion(uWcxModule.GetErrorMsg(OpenResult), '', [fsourOk], fsourOk, fsourOk);
RaiseAbortOperation;
end;
FileMask := ExtractFileName(TargetPath);
if FileMask = '' then FileMask := '*'; // extract all selected files/folders
// Convert file list so that filenames are relative to archive root.
Files := SourceFiles.Clone;
ChangeFileListRoot(PathDelim, Files);
CreatedPaths := TStringHashList.Create(True);
try
// Count total files size and create needed directories.
CreateDirsAndCountFiles(Files, FileMask,
TargetPath, Files.Path,
CreatedPaths);
WcxModule.SetChangeVolProc(ArcHandle, @ChangeVolProc);
WcxModule.SetProcessDataProc(ArcHandle, @ProcessDataProc);
while (WcxModule.ReadWCXHeader(ArcHandle, Header) = E_SUCCESS) do
try
CheckOperationState;
// Now check if the file is to be extracted.
if (not FPS_ISDIR(Header.FileAttr)) // Omit directories (we handle them ourselves).
and MatchesFileList(Files, Header.FileName) // Check if it's included in the filelist
and ((FileMask = '*.*') or (FileMask = '*') // And name matches file mask
or MatchesMaskList(ExtractFileName(Header.FileName), FileMask))
then
begin
TargetFileName := TargetPath + ExtractDirLevel(Files.Path, Header.FileName);
with FStatistics do
begin
CurrentFileFrom := Header.FileName;
CurrentFileTo := TargetFileName;
CurrentFileTotalBytes := Header.UnpSize;
CurrentFileDoneBytes := 0;
UpdateStatistics(FStatistics);
FCurrentFileSize := Header.UnpSize;
end;
iResult := WcxModule.ProcessFile(ArcHandle, PK_EXTRACT, nil, PAnsiChar(UTF8ToSys(TargetFileName)));
if iResult <> E_SUCCESS then
begin
ShowError(Format(rsMsgLogError + rsMsgLogExtract,
[FWcxArchiveFileSource.ArchiveFileName + PathDelim +
Header.FileName + ' -> ' + TargetFileName +
' - ' + GetErrorMsg(iResult)]), [log_arc_op]);
// User aborted operation.
if iResult = E_EABORTED then
Break;
end // Error
else
begin
LogMessage(Format(rsMsgLogSuccess + rsMsgLogExtract,
[FWcxArchiveFileSource.ArchiveFileName + PathDelim +
Header.FileName +' -> ' + TargetFileName]), [log_arc_op], lmtSuccess);
end; // Success
end // Extract
else // Skip
begin
iResult := WcxModule.ProcessFile(ArcHandle, PK_SKIP, nil, nil);
//Check for errors
if iResult <> E_SUCCESS then
begin
ShowError(Format(rsMsgLogError + rsMsgLogExtract,
[FWcxArchiveFileSource.ArchiveFileName + PathDelim +
Header.FileName + ' -> ' + TargetFileName +
' - ' + GetErrorMsg(iResult)]), [log_arc_op]);
end;
end; // Skip
finally
FreeAndNil(Header);
end;
WcxModule.CloseArchive(ArcHandle);
SetDirsAttributes(CreatedPaths);
finally
if Assigned(Files) then
FreeAndNil(Files);
FreeAndNil(CreatedPaths);
end;
end;
procedure TWcxArchiveCopyOutOperation.Finalize;
begin
WcxCopyOutOperation := nil;
end;
procedure TWcxArchiveCopyOutOperation.CreateDirsAndCountFiles(
const theFiles: TFiles; FileMask: String;
sDestPath: String; CurrentArchiveDir: String;
var CreatedPaths: TStringHashList);
var
// List of paths that we know must be created.
PathsToCreate: TStringHashList;
// List of possible directories to create with their attributes.
// This hash list is created to speed up searches for attributes in archive file list.
DirsAttributes: TStringHashList;
i: Integer;
CurrentFileName: String;
Header: TWCXHeader;
Directories: TStringList;
PathIndex: Integer;
ListIndex: Integer;
TargetDir: String;
FileList: TObjectList;
begin
FileList := FWcxArchiveFileSource.ArchiveFileList;
{ First, collect all the paths that need to be created and their attributes. }
PathsToCreate := TStringHashList.Create(True);
DirsAttributes := TStringHashList.Create(True);
for i := 0 to FileList.Count - 1 do
begin
Header := TWCXHeader(FileList.Items[i]);
// Check if the file from the archive fits the selection given via SourceFiles.
if not MatchesFileList(theFiles, Header.FileName) then
Continue;
if FPS_ISDIR(Header.FileAttr) then
begin
CurrentFileName := ExtractDirLevel(CurrentArchiveDir, Header.FileName);
// Save this directory and a pointer to its entry.
DirsAttributes.Add(CurrentFileName, Header);
// If extracting all files and directories, add this directory
// to PathsToCreate so that empty directories are also created.
if (FileMask = '*.*') or (FileMask = '*') then
begin
// Paths in PathsToCreate list must end with path delimiter.
CurrentFileName := IncludeTrailingPathDelimiter(CurrentFileName);
if PathsToCreate.Find(CurrentFileName) < 0 then
PathsToCreate.Add(CurrentFileName);
end;
end
else
begin
if ((FileMask = '*.*') or (FileMask = '*') or
MatchesMaskList(ExtractFileName(Header.FileName), FileMask)) then
begin
Inc(FStatistics.TotalBytes, Header.UnpSize);
Inc(FStatistics.TotalFiles, 1);
CurrentFileName := ExtractDirLevel(CurrentArchiveDir, ExtractFilePath(Header.FileName));
// If CurrentFileName is empty now then it was a file in current archive
// directory, therefore we don't have to create any paths for it.
if Length(CurrentFileName) > 0 then
if PathsToCreate.Find(CurrentFileName) < 0 then
PathsToCreate.Add(CurrentFileName);
end;
end;
end;
{ Second, create paths and save which paths were created and their attributes. }
Directories := TStringList.Create;
try
sDestPath := IncludeTrailingPathDelimiter(sDestPath);
// Create path to destination directory (we don't have attributes for that).
mbForceDirectory(sDestPath);
CreatedPaths.Clear;
for PathIndex := 0 to PathsToCreate.Count - 1 do
begin
Directories.Clear;
// Create also all parent directories of the path to create.
// This adds directories to list in order from the outer to inner ones,
// for example: dir, dir/dir2, dir/dir2/dir3.
if GetDirs(PathsToCreate.List[PathIndex]^.Key, Directories) <> -1 then
try
for i := 0 to Directories.Count - 1 do
begin
TargetDir := sDestPath + Directories.Strings[i];
if (CreatedPaths.Find(TargetDir) = -1) and
(not DirPathExists(TargetDir)) then
begin
if mbForceDirectory(TargetDir) = False then
begin
// Error, cannot create directory.
Break; // Don't try to create subdirectories.
end
else
begin
// Retrieve attributes for this directory, if they are stored.
ListIndex := DirsAttributes.Find(Directories.Strings[i]);
if ListIndex <> -1 then
Header := TWcxHeader(DirsAttributes.List[ListIndex]^.Data)
else
Header := nil;
CreatedPaths.Add(TargetDir, Header);
end;
end;
end;
except
end;
end;
finally
FreeAndNil(PathsToCreate);
FreeAndNil(DirsAttributes);
FreeAndNil(Directories);
end;
end;
function TWcxArchiveCopyOutOperation.SetDirsAttributes(const Paths: TStringHashList): Boolean;
var
PathIndex: Integer;
TargetDir: String;
Header: TWCXHeader;
Time: Longint;
begin
Result := True;
for PathIndex := 0 to Paths.Count - 1 do
begin
// Get attributes.
Header := TWCXHeader(Paths.List[PathIndex]^.Data);
if Assigned(Header) then
begin
TargetDir := Paths.List[PathIndex]^.Key;
try
{$IF DEFINED(MSWINDOWS)}
// Restore attributes, e.g., hidden, read-only.
// On Unix attributes value would have to be translated somehow.
mbFileSetAttr(TargetDir, Header.FileAttr);
{$ENDIF}
Time := Header.FileTime;
// Set creation, modification time
mbFileSetTime(TargetDir, Time, Time, Time);
except
Result := False;
end;
end;
end;
end;
procedure TWcxArchiveCopyOutOperation.ShowError(sMessage: String; logOptions: TLogOptions);
begin
if not gSkipFileOpError then
begin
if AskQuestion(sMessage, '', [fsourSkip, fsourCancel],
fsourSkip, fsourAbort) = fsourAbort then
begin
RaiseAbortOperation;
end;
end
else
begin
LogMessage(sMessage, logOptions, lmtError);
end;
end;
procedure TWcxArchiveCopyOutOperation.LogMessage(sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
begin
case logMsgType of
lmtError:
if not (log_errors in gLogOptions) then Exit;
lmtInfo:
if not (log_info in gLogOptions) then Exit;
lmtSuccess:
if not (log_success in gLogOptions) then Exit;
end;
if logOptions <= gLogOptions then
begin
logWrite(Thread, sMessage, logMsgType);
end;
end;
end.

View file

@ -47,7 +47,7 @@ type
implementation
uses
uOSUtils, uDCUtils, uLng, uWCXmodule, uWCXhead, Masks, FileUtil, LCLProc;
uOSUtils, uDCUtils, uLng, uWCXmodule, WcxPlugin, Masks, FileUtil, LCLProc;
// ----------------------------------------------------------------------------
// WCX callbacks

View file

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, contnrs, Dialogs, StringHashList, uOSUtils,
uWCXhead, uWCXmodule, uFile, uFileSourceProperty, uFileSourceOperationTypes,
WcxPlugin, uWCXmodule, uFile, uFileSourceProperty, uFileSourceOperationTypes,
uArchiveFileSource, uFileProperty, uFileSource, uFileSourceOperation;
type

View file

@ -53,7 +53,7 @@ type
implementation
uses
ufsplugin, uFileSystemUtil;
WfxPlugin, uFileSystemUtil;
// -- TWfxPluginCopyInOperation ---------------------------------------------

View file

@ -1,152 +1,152 @@
unit uWfxPluginCopyOutOperation;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils,
uFileSourceCopyOperation,
uFileSource,
uFileSourceOperation,
uFileSourceOperationOptions,
uFile,
uWfxPluginFileSource,
uWfxPluginUtil;
type
{ TWfxPluginCopyOutOperation }
TWfxPluginCopyOutOperation = class(TFileSourceCopyOutOperation)
private
FWfxPluginFileSource: TWfxPluginFileSource;
FOperationHelper: TWfxPluginOperationHelper;
FUpdateProgressClass: TUpdateProgressClass;
FFullFilesTreeToCopy: TFiles; // source files including all files/dirs in subdirectories
FStatistics: TFileSourceCopyOperationStatistics; // local copy of statistics
// Options
FInternal: Boolean;
FFileExistsOption: TFileSourceOperationOptionFileExists;
protected
function UpdateProgress(SourceName, TargetName: UTF8String; PercentDone: Integer): Integer;
public
constructor Create(var aSourceFileSource: TFileSource;
var aTargetFileSource: TFileSource;
var theSourceFiles: TFiles;
aTargetPath: String); override;
destructor Destroy; override;
procedure Initialize; override;
procedure MainExecute; override;
procedure Finalize; override;
property FileExistsOption: TFileSourceOperationOptionFileExists read FFileExistsOption write FFileExistsOption;
end;
implementation
uses
ufsplugin;
// -- TWfxPluginCopyOutOperation ---------------------------------------------
function TWfxPluginCopyOutOperation.UpdateProgress(SourceName, TargetName: UTF8String;
PercentDone: Integer): Integer;
begin
Result := 0;
//DebugLn('SourceName=', SourceName, #32, 'TargetName=', TargetName, #32, 'PercentDone=', IntToStr(PercentDone));
if State = fsosStopping then // Cancel operation
Exit(1);
with FStatistics do
begin
FStatistics.CurrentFileFrom:= SourceName;
FStatistics.CurrentFileTo:= TargetName;
CurrentFileDoneBytes:= CurrentFileTotalBytes * PercentDone div 100;
DoneBytes := DoneBytes + CurrentFileDoneBytes;
UpdateStatistics(FStatistics);
end;
end;
constructor TWfxPluginCopyOutOperation.Create(var aSourceFileSource: TFileSource;
var aTargetFileSource: TFileSource;
var theSourceFiles: TFiles;
aTargetPath: String);
begin
FWfxPluginFileSource:= aSourceFileSource as TWfxPluginFileSource;
FUpdateProgressClass:= TUpdateProgressClass.Create;
FInternal:= aTargetFileSource is TWfxPluginFileSource;
inherited Create(aSourceFileSource, aTargetFileSource, theSourceFiles, aTargetPath);
end;
destructor TWfxPluginCopyOutOperation.Destroy;
begin
if Assigned(FUpdateProgressClass) then
FreeAndNil(FUpdateProgressClass);
inherited Destroy;
end;
procedure TWfxPluginCopyOutOperation.Initialize;
begin
FUpdateProgressClass.UpdateProgressFunction:= @UpdateProgress;
with FWfxPluginFileSource do
begin
WfxStatusInfo(CurrentPath, FS_STATUS_START, FS_STATUS_OP_PUT_MULTI);
WfxOperationList[PluginNumber]:= FUpdateProgressClass;
// Get initialized statistics; then we change only what is needed.
FStatistics := RetrieveStatistics;
FillAndCount(SourceFiles,
FFullFilesTreeToCopy,
FStatistics.TotalFiles,
FStatistics.TotalBytes); // gets full list of files (recursive)
end;
// Make filenames relative to current directory.
FFullFilesTreeToCopy.Path := SourceFiles.Path;
if Assigned(FOperationHelper) then
FreeAndNil(FOperationHelper);
FOperationHelper := TWfxPluginOperationHelper.Create(
FWfxPluginFileSource,
@AskQuestion,
@RaiseAbortOperation,
@CheckOperationState,
@UpdateStatistics,
Thread,
wpohmCopyMoveOut,
TargetPath,
FStatistics);
FOperationHelper.RenameMask := RenameMask;
FOperationHelper.FileExistsOption := FileExistsOption;
FOperationHelper.Initialize(FInternal);
end;
procedure TWfxPluginCopyOutOperation.MainExecute;
begin
FOperationHelper.ProcessFiles(FFullFilesTreeToCopy);
end;
procedure TWfxPluginCopyOutOperation.Finalize;
begin
with FWfxPluginFileSource do
begin
WfxStatusInfo(CurrentPath, FS_STATUS_END, FS_STATUS_OP_PUT_MULTI);
WfxOperationList[PluginNumber]:= nil;
end;
end;
end.
unit uWfxPluginCopyOutOperation;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils,
uFileSourceCopyOperation,
uFileSource,
uFileSourceOperation,
uFileSourceOperationOptions,
uFile,
uWfxPluginFileSource,
uWfxPluginUtil;
type
{ TWfxPluginCopyOutOperation }
TWfxPluginCopyOutOperation = class(TFileSourceCopyOutOperation)
private
FWfxPluginFileSource: TWfxPluginFileSource;
FOperationHelper: TWfxPluginOperationHelper;
FUpdateProgressClass: TUpdateProgressClass;
FFullFilesTreeToCopy: TFiles; // source files including all files/dirs in subdirectories
FStatistics: TFileSourceCopyOperationStatistics; // local copy of statistics
// Options
FInternal: Boolean;
FFileExistsOption: TFileSourceOperationOptionFileExists;
protected
function UpdateProgress(SourceName, TargetName: UTF8String; PercentDone: Integer): Integer;
public
constructor Create(var aSourceFileSource: TFileSource;
var aTargetFileSource: TFileSource;
var theSourceFiles: TFiles;
aTargetPath: String); override;
destructor Destroy; override;
procedure Initialize; override;
procedure MainExecute; override;
procedure Finalize; override;
property FileExistsOption: TFileSourceOperationOptionFileExists read FFileExistsOption write FFileExistsOption;
end;
implementation
uses
WfxPlugin;
// -- TWfxPluginCopyOutOperation ---------------------------------------------
function TWfxPluginCopyOutOperation.UpdateProgress(SourceName, TargetName: UTF8String;
PercentDone: Integer): Integer;
begin
Result := 0;
//DebugLn('SourceName=', SourceName, #32, 'TargetName=', TargetName, #32, 'PercentDone=', IntToStr(PercentDone));
if State = fsosStopping then // Cancel operation
Exit(1);
with FStatistics do
begin
FStatistics.CurrentFileFrom:= SourceName;
FStatistics.CurrentFileTo:= TargetName;
CurrentFileDoneBytes:= CurrentFileTotalBytes * PercentDone div 100;
DoneBytes := DoneBytes + CurrentFileDoneBytes;
UpdateStatistics(FStatistics);
end;
end;
constructor TWfxPluginCopyOutOperation.Create(var aSourceFileSource: TFileSource;
var aTargetFileSource: TFileSource;
var theSourceFiles: TFiles;
aTargetPath: String);
begin
FWfxPluginFileSource:= aSourceFileSource as TWfxPluginFileSource;
FUpdateProgressClass:= TUpdateProgressClass.Create;
FInternal:= aTargetFileSource is TWfxPluginFileSource;
inherited Create(aSourceFileSource, aTargetFileSource, theSourceFiles, aTargetPath);
end;
destructor TWfxPluginCopyOutOperation.Destroy;
begin
if Assigned(FUpdateProgressClass) then
FreeAndNil(FUpdateProgressClass);
inherited Destroy;
end;
procedure TWfxPluginCopyOutOperation.Initialize;
begin
FUpdateProgressClass.UpdateProgressFunction:= @UpdateProgress;
with FWfxPluginFileSource do
begin
WfxStatusInfo(CurrentPath, FS_STATUS_START, FS_STATUS_OP_PUT_MULTI);
WfxOperationList[PluginNumber]:= FUpdateProgressClass;
// Get initialized statistics; then we change only what is needed.
FStatistics := RetrieveStatistics;
FillAndCount(SourceFiles,
FFullFilesTreeToCopy,
FStatistics.TotalFiles,
FStatistics.TotalBytes); // gets full list of files (recursive)
end;
// Make filenames relative to current directory.
FFullFilesTreeToCopy.Path := SourceFiles.Path;
if Assigned(FOperationHelper) then
FreeAndNil(FOperationHelper);
FOperationHelper := TWfxPluginOperationHelper.Create(
FWfxPluginFileSource,
@AskQuestion,
@RaiseAbortOperation,
@CheckOperationState,
@UpdateStatistics,
Thread,
wpohmCopyMoveOut,
TargetPath,
FStatistics);
FOperationHelper.RenameMask := RenameMask;
FOperationHelper.FileExistsOption := FileExistsOption;
FOperationHelper.Initialize(FInternal);
end;
procedure TWfxPluginCopyOutOperation.MainExecute;
begin
FOperationHelper.ProcessFiles(FFullFilesTreeToCopy);
end;
procedure TWfxPluginCopyOutOperation.Finalize;
begin
with FWfxPluginFileSource do
begin
WfxStatusInfo(CurrentPath, FS_STATUS_END, FS_STATUS_OP_PUT_MULTI);
WfxOperationList[PluginNumber]:= nil;
end;
end;
end.

View file

@ -49,7 +49,7 @@ type
implementation
uses
LCLProc, FileUtil, uOSUtils, uLng, ufsplugin;
LCLProc, FileUtil, uOSUtils, uLng, WfxPlugin;
constructor TWfxPluginDeleteOperation.Create(var aTargetFileSource: TFileSource;
var theFilesToDelete: TFiles);

View file

@ -37,7 +37,7 @@ type
implementation
uses
ufsplugin;
WfxPlugin;
constructor TWfxPluginExecuteOperation.Create(
var aTargetFileSource: TFileSource;

View file

@ -9,7 +9,7 @@ uses
uFile,
uFileSystemFile,
uFileProperty,
ufsplugin,
WfxPlugin,
uOSUtils;
type

View file

@ -5,7 +5,7 @@ unit uWfxPluginFileSource;
interface
uses
Classes, SysUtils, uWFXModule, ufsplugin,
Classes, SysUtils, uWFXModule, WfxPlugin,
uFile, uFileSourceProperty, uFileSourceOperationTypes,
uFileProperty, uFileSource, uFileSourceOperation;

View file

@ -23,7 +23,7 @@ type
implementation
uses
LCLProc, FileUtil, uOSUtils, uDCUtils, uWfxPluginFile, uFile, ufsplugin;
LCLProc, FileUtil, uOSUtils, uDCUtils, uWfxPluginFile, uFile, WfxPlugin;
constructor TWfxPluginListOperation.Create(var aFileSource: TFileSource);
begin

View file

@ -83,7 +83,7 @@ type
implementation
uses
uFileProcs, uDCUtils, uLng, ufsplugin, uWfxModule, uFileSystemUtil, uOSUtils;
uFileProcs, uDCUtils, uLng, WfxPlugin, uWfxModule, uFileSystemUtil, uOSUtils;
{ TWfxPluginOperationHelper }

File diff suppressed because it is too large Load diff

View file

@ -29,7 +29,7 @@ unit udsxmodule;
interface
uses
Classes, SysUtils, dynlibs,LCLProc,uGlobs,udsxplugin,uClassesEx, uDCUtils, uOSUtils;
Classes, SysUtils, dynlibs, LCLProc, uGlobs, DsxPlugin,uClassesEx, uDCUtils, uOSUtils;
type

View file

@ -28,7 +28,7 @@ unit uFindThread;
interface
uses
Classes, StdCtrls, SysUtils, udsxplugin;
Classes, StdCtrls, SysUtils, DsxPlugin;
type

View file

@ -27,7 +27,7 @@ unit uSearchTemplate;
interface
uses
Classes, SysUtils, uDSXPlugin, uClassesEx, uTypes, uFile;
Classes, SysUtils, DsxPlugin, uClassesEx, uTypes, uFile;
type

View file

@ -28,7 +28,7 @@ unit uWCXmodule;
interface
uses
uWCXprototypes, uWCXhead, dynlibs, Classes, uVFSModule,
uWCXprototypes, WcxPlugin, dynlibs, Classes, uVFSModule,
uVFSTypes, Dialogs, DialogAPI, uClassesEx, uOSUtils;
Type

View file

@ -1,32 +1,32 @@
unit uWCXprototypes;
{$mode objfpc}{$H+}
interface
uses
LCLType, uWCXhead;
type
{mandatory}
TOpenArchive = function (var ArchiveData : tOpenArchiveData): TArcHandle;stdcall;
TReadHeader = function (hArcData: TArcHandle; var HeaderData : THeaderData): integer;stdcall;
TProcessFile = function (hArcData: TArcHandle; Operation: integer; DestPath: pchar; DestName: pchar): integer;stdcall;
TCloseArchive = function (hArcData: TArcHandle): integer;stdcall;
{Optional}
TPackFiles = function (PackedFile: pchar; SubPath: pchar; SrcPath: pchar; AddList: pchar; Flags: integer): integer;stdcall;
TDeleteFiles = function (PackedFile: pchar; DeleteList: pchar): integer;stdcall;
TGetPackerCaps = function () : integer;stdcall;
TConfigurePacker = procedure (Parent: THandle; DllInstance: THandle);stdcall;
TSetChangeVolProc = procedure (hArcData: TArcHandle; pChangeVolProc1: tChangeVolProc);stdcall;
TSetProcessDataProc = procedure (hArcData: TArcHandle; pProcessDataProc: TProcessDataProc);stdcall;
TStartMemPack = function (Options: integer; FileName: pchar): integer;stdcall;
TPackToMem = function (hMemPack: integer; BufIn: pchar; InLen: integer; Taken: pinteger; BufOut: pchar; OutLen: integer; Written: pinteger; SeekBy: integer): integer;stdcall;
TDoneMemPack = function (hMemPack: integer): integer;stdcall;
TCanYouHandleThisFile = function (FileName: pchar): boolean;stdcall;
TPackSetDefaultParams = procedure (dps: pPackDefaultParamStruct);stdcall;
TReadHeaderEx = function (hArcData: TArcHandle; var HeaderDataEx : THeaderDataEx): integer;stdcall;
implementation
end.
unit uWCXprototypes;
{$mode objfpc}{$H+}
interface
uses
LCLType, WcxPlugin;
type
{mandatory}
TOpenArchive = function (var ArchiveData : tOpenArchiveData): TArcHandle;stdcall;
TReadHeader = function (hArcData: TArcHandle; var HeaderData : THeaderData): integer;stdcall;
TProcessFile = function (hArcData: TArcHandle; Operation: integer; DestPath: pchar; DestName: pchar): integer;stdcall;
TCloseArchive = function (hArcData: TArcHandle): integer;stdcall;
{Optional}
TPackFiles = function (PackedFile: pchar; SubPath: pchar; SrcPath: pchar; AddList: pchar; Flags: integer): integer;stdcall;
TDeleteFiles = function (PackedFile: pchar; DeleteList: pchar): integer;stdcall;
TGetPackerCaps = function () : integer;stdcall;
TConfigurePacker = procedure (Parent: THandle; DllInstance: THandle);stdcall;
TSetChangeVolProc = procedure (hArcData: TArcHandle; pChangeVolProc1: tChangeVolProc);stdcall;
TSetProcessDataProc = procedure (hArcData: TArcHandle; pProcessDataProc: TProcessDataProc);stdcall;
TStartMemPack = function (Options: integer; FileName: pchar): integer;stdcall;
TPackToMem = function (hMemPack: integer; BufIn: pchar; InLen: integer; Taken: pinteger; BufOut: pchar; OutLen: integer; Written: pinteger; SeekBy: integer): integer;stdcall;
TDoneMemPack = function (hMemPack: integer): integer;stdcall;
TCanYouHandleThisFile = function (FileName: pchar): boolean;stdcall;
TPackSetDefaultParams = procedure (dps: pPackDefaultParamStruct);stdcall;
TReadHeaderEx = function (hArcData: TArcHandle; var HeaderDataEx : THeaderDataEx): integer;stdcall;
implementation
end.

View file

@ -37,7 +37,7 @@ uses
Windows,
{$ENDIF}
Classes, SysUtils,uClassesEx,
uwdxprototypes,ucontplugin,
uwdxprototypes,WdxPlugin,
dynlibs, uDCUtils, uOSUtils,
uDetectStr, uTypes,lua,LCLProc;

View file

@ -4,8 +4,8 @@ unit uwdxprototypes;
interface
uses ucontplugin,
Classes, SysUtils;
uses
Classes, SysUtils, WdxPlugin;
type
// Mandatory (must be implemented)

View file

@ -31,7 +31,7 @@ unit uWFXmodule;
interface
uses
SysUtils, Classes, uVFSModule, uVFSTypes, ufsplugin, uWFXprototypes,
SysUtils, Classes, uVFSModule, uVFSTypes, WfxPlugin, uWFXprototypes,
dynlibs, uClassesEx, DialogAPI;
const

View file

@ -5,7 +5,7 @@ unit uWFXprototypes;
interface
uses
{Classes, SysUtils,} ufsplugin, uOSUtils;
{Classes, SysUtils,} WfxPlugin, uOSUtils;
type
{File system plugins API (version 1.5) for TC}