mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Sample wcx-plugin
This commit is contained in:
parent
698d682e04
commit
214957c269
2 changed files with 189 additions and 0 deletions
115
plugins/wcx/sample/src/sample.lpi
Normal file
115
plugins/wcx/sample/src/sample.lpi
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="12"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
<MainUnitHasTitleStatement Value="False"/>
|
||||
<MainUnitHasScaledStatement Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<Title Value="sample"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
</General>
|
||||
<BuildModes>
|
||||
<Item Name="Debug" Default="True"/>
|
||||
<Item Name="Release">
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="..\sample.wcx" ApplyConventions="False"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value="..\..\..\..\sdk"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<RelocatableUnit Value="True"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="3"/>
|
||||
</Optimizations>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
<RunWithoutDebug Value="True"/>
|
||||
<StripSymbols Value="True"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<ExecutableType Value="Library"/>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
</Item>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<UseFileFilters Value="True"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
</RunParams>
|
||||
<Units>
|
||||
<Unit>
|
||||
<Filename Value="sample.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="..\sample.wcx" ApplyConventions="False"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value="..\..\..\..\sdk"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<IncludeAssertionCode Value="True"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<CodeGeneration>
|
||||
<RelocatableUnit Value="True"/>
|
||||
<Checks>
|
||||
<IOChecks Value="True"/>
|
||||
<RangeChecks Value="True"/>
|
||||
<OverflowChecks Value="True"/>
|
||||
<StackChecks Value="True"/>
|
||||
</Checks>
|
||||
<VerifyObjMethodCallValidity Value="True"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf3"/>
|
||||
<TrashVariables Value="True"/>
|
||||
</Debugging>
|
||||
<Options>
|
||||
<ExecutableType Value="Library"/>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions>
|
||||
<Item>
|
||||
<Name Value="EAbort"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
||||
74
plugins/wcx/sample/src/sample.lpr
Normal file
74
plugins/wcx/sample/src/sample.lpr
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
library sample;
|
||||
|
||||
uses
|
||||
SysUtils,
|
||||
Classes,
|
||||
WcxPlugin;
|
||||
|
||||
function GetPackerCaps : Integer; winapi; export;
|
||||
begin
|
||||
Result:= PK_CAPS_MULTIPLE or PK_CAPS_BY_CONTENT or PK_CAPS_HIDE;
|
||||
end;
|
||||
|
||||
function OpenArchive(var ArchiveData : TOpenArchiveData) : TArcHandle; winapi; export;
|
||||
var
|
||||
Handle: PBoolean absolute Result;
|
||||
begin
|
||||
New(Handle);
|
||||
Handle^:= True;
|
||||
ArchiveData.OpenResult:= E_SUCCESS;
|
||||
end;
|
||||
|
||||
function CloseArchive(hArcData : TArcHandle) : Integer; winapi; export;
|
||||
var
|
||||
Handle: PBoolean absolute hArcData;
|
||||
begin
|
||||
Dispose(Handle);
|
||||
Result:= E_SUCCESS;
|
||||
end;
|
||||
|
||||
function ReadHeader(hArcData : TArcHandle; var HeaderData : THeaderData) : Integer; winapi; export;
|
||||
var
|
||||
Handle: PBoolean absolute hArcData;
|
||||
begin
|
||||
if Handle^ then
|
||||
begin
|
||||
Handle^:= False;
|
||||
Result:= E_SUCCESS;
|
||||
HeaderData.FileName:= 'Hello.txt';
|
||||
end
|
||||
else begin
|
||||
Result:= E_NO_FILES;
|
||||
end;
|
||||
end;
|
||||
|
||||
function ProcessFile(hArcData : TArcHandle; Operation : Integer; DestPath : PChar; DestName : PChar) : Integer; winapi; export;
|
||||
begin
|
||||
Result:= E_SUCCESS;
|
||||
end;
|
||||
|
||||
procedure SetProcessDataProc(hArcData : TArcHandle; ProcessDataProc : TProcessDataProc); winapi; export;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure SetChangeVolProc(hArcData : TArcHandle; ChangeVolProc : TChangeVolProc); winapi; export;
|
||||
begin
|
||||
end;
|
||||
|
||||
function CanYouHandleThisFile(FileName: PAnsiChar): LongBool; winapi; export;
|
||||
begin
|
||||
Result:= False;
|
||||
end;
|
||||
|
||||
exports
|
||||
CloseArchive,
|
||||
GetPackerCaps,
|
||||
OpenArchive,
|
||||
ProcessFile,
|
||||
ReadHeader,
|
||||
SetChangeVolProc,
|
||||
SetProcessDataProc,
|
||||
CanYouHandleThisFile;
|
||||
|
||||
end.
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue