1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-30 12:52:16 -05:00

Merge branch 'lape-integration' into tests

This commit is contained in:
Merlijn Wajer 2011-08-05 12:30:59 +02:00
commit aaf8cc718a
36 changed files with 5393 additions and 45 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "Units/lape"]
path = Units/lape
url = git://villavu.com/lape.git

View File

@ -29,9 +29,9 @@
//{$DEFINE SIMBA_VERBOSE} // For more verbosity.
//{$DEFINE USE_RUTIS}
{$DEFINE USE_LAPE}
//{$DEFINE USE_CPASCAL} // TODO
//{$DEFINE USE_LAPE} // TODO
{$DEFINE USE_EXTENSIONS}
//{$DEFINE USE_CODECOMPLETION} // TODO

View File

@ -321,8 +321,8 @@
<Filename Value="../../Simba"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);$(ProjPath)../../Units/MMLAddon/PSInc"/>
<OtherUnitFiles Value="$(ProjPath);$(ProjPath)../../Units/MMLCore;$(ProjPath)../../Units/MMLAddon;$(ProjPath)../../Units/PascalScript;$(ProjPath)../../Units/Misc;$(ProjPath)../../Units/MMLAddon/PSInc;$(ProjPath)../../Units/Linux;$(ProjPath)../../Units/Synapse;$(LazarusDir)/components/mouseandkeyinput;$(ProjPath)../../Units/RUTIS"/>
<IncludeFiles Value="$(ProjOutDir);$(ProjPath)../../Units/MMLAddon/PSInc;$(ProjPath)../../Units/MMLAddon/LPInc"/>
<OtherUnitFiles Value="$(ProjPath);$(ProjPath)../../Units/MMLCore;$(ProjPath)../../Units/MMLAddon;$(ProjPath)../../Units/PascalScript;$(ProjPath)../../Units/lape;$(ProjPath)../../Units/Misc;$(ProjPath)../../Units/MMLAddon/PSInc;$(ProjPath)../../Units/Linux;$(ProjPath)../../Units/Synapse;$(LazarusDir)/components/mouseandkeyinput;$(ProjPath)../../Units/RUTIS"/>
<UnitOutputDirectory Value="$(ProjPath)../../build/$(TargetOS)"/>
</SearchPaths>
<Parsing>

View File

@ -1263,12 +1263,18 @@ object SimbaForm: TSimbaForm
end
object MenuItemRUTIS: TMenuItem
Action = ActionRUTIS
Enabled = False
RadioItem = True
end
object MenuItemCPascal: TMenuItem
Action = ActionCPascal
RadioItem = True
end
object MenuItemLape: TMenuItem
Action = ActionLape
Enabled = False
RadioItem = True
end
end
end
object MenuView: TMenuItem
@ -3026,6 +3032,10 @@ object SimbaForm: TSimbaForm
OnExecute = ActionGotoExecute
ShortCut = 16455
end
object ActionLape: TAction
Caption = 'Lape'
OnExecute = ActionLapeExecute
end
end
object DebugTimer: TTimer
OnTimer = ProcessDebugStream

View File

@ -67,6 +67,7 @@ const
interp_PS = 0; //PascalScript
interp_RT = 1; //RUTIS
interp_CP = 2; //CPascal
interp_LP = 3; //Lape
{ Place the shortcuts here }
{$IFDEF LINUX}
@ -101,6 +102,7 @@ type
{ TSimbaForm }
TSimbaForm = class(TForm)
ActionLape: TAction;
ActionGoto: TAction;
ActionCPascal: TAction;
ActionRUTIS: TAction;
@ -146,6 +148,7 @@ type
MenuHelp: TMenuItem;
MenuDivider7: TMenuItem;
MenuInterpreters: TMenuItem;
MenuItemLape: TMenuItem;
MenuItemReadOnlyTab: TMenuItem;
MenuItemGoto: TMenuItem;
MenuItemDivider50: TMenuItem;
@ -286,6 +289,7 @@ type
procedure ActionFindNextExecute(Sender: TObject);
procedure ActionFindstartExecute(Sender: TObject);
procedure ActionGotoExecute(Sender: TObject);
procedure ActionLapeExecute(Sender: TObject);
procedure ActionNewExecute(Sender: TObject);
procedure ActionNewTabExecute(Sender: TObject);
procedure ActionNormalSizeExecute(Sender: TObject);
@ -735,13 +739,15 @@ end;
procedure TSimbaForm.UpdateInterpreter;
begin
ActionPascalScript.Checked:= false;
ActionRUTIS.Checked:= false;
ActionCPascal.Checked:= false;
ActionPascalScript.Checked := False;
ActionRUTIS.Checked := False;
ActionCPascal.Checked := False;
ActionLape.Checked := False;
case Interpreter of
interp_PS: ActionPascalScript.Checked:= True;
interp_CP: ActionCPascal.Checked:= True;
interp_RT: ActionRUTIS.Checked:= true;
interp_RT: ActionRUTIS.Checked := True;
interp_LP: ActionLape.Checked := True;
end;
end;
@ -768,11 +774,11 @@ end;
function TSimbaForm.GetInterpreter: Integer;
begin
result := StrToIntDef(LoadSettingDef('Settings/Interpreter/Type','0'),0);
if (result < 0) or (result > 2) then
Result := StrToIntDef(LoadSettingDef('Settings/Interpreter/Type', '0'), 0);
if ((Result < 0) or (Result > 3)) then
begin
SetInterpreter(0);
result := 0;
Result := 0;
end;
end;
@ -990,7 +996,7 @@ var
time:integer;
LatestVersion : integer;
begin
UpdateTimer.Interval:= MaxInt;
UpdateTimer.Interval := MaxInt;
FontUpdate;
chk := LowerCase(LoadSettingDef('Settings/Updater/CheckForUpdates','True'));
@ -1009,7 +1015,7 @@ begin
mDebugLn('Latest Simba Version: ' + IntToStr(LatestVersion));
end;
time := StrToIntDef(LoadSettingDef('Settings/Updater/CheckEveryXMinutes','30'),30);
UpdateTimer.Interval:= time {mins} * 60 {secs} * 1000 {ms};//Every half hour
UpdateTimer.Interval := time {mins} * 60 {secs} * 1000 {ms};//Every half hour
end;
procedure TSimbaForm.UpdateMenuButtonClick(Sender: TObject);
@ -1418,7 +1424,7 @@ begin
SettingsForm.SettingsTreeView.Items.GetFirstNode.Expand(false);
SettingsForm.SaveCurrent;
LoadFormSettings;
UpdateTimer.Interval:=25;
UpdateTimer.Interval :=25;
end;
{ Load settings }
@ -1635,19 +1641,25 @@ begin
AppPath:= MainDir + DS;
CurrScript.ScriptErrorLine:= -1;
CurrentSyncInfo.SyncMethod:= @Self.SafeCallThread;
try
case Interpreter of
interp_PS : Thread := TPSThread.Create(true,@CurrentSyncInfo,PluginPath);
// XXX: Rutis needs to be completely removed from Simba if it's not defined.
// XXX: Not just print a message that it's not supported now.
interp_RT : {$IFDEF USE_RUTIS}Thread := TRTThread.Create(true,@CurrentSyncInfo,PluginPath){$ELSE}formWriteln('RUTIS NOT SUPPORTED') {$ENDIF};
interp_CP : Thread := TCPThread.Create(true,@CurrentSyncInfo,PluginPath);
interp_PS: Thread := TPSThread.Create(True, @CurrentSyncInfo, PluginPath);
{$IFDEF USE_RUTIS}interp_RT: Thread := TRTThread.Create(True, @CurrentSyncInfo, PluginPath);{$ENDIF}
interp_CP: Thread := TCPThread.Create(True,@CurrentSyncInfo,PluginPath);
{$IFDEF USE_LAPE}interp_LP: Thread := TLPThread.Create(True, @CurrentSyncInfo, PluginPath);{$ENDIF}
else
raise Exception.CreateFmt('Unknown Interpreter %d!', [Interpreter]);
end;
except
mDebugLn('Failed to initialise the interpreter');
on E: Exception do
begin
mDebugLn('Failed to initialise the interpreter: ' + E.Message);
Thread := nil;
Exit;
end;
end;
{$IFNDEF TERMINALWRITELN}
Thread.SetDebug(@formWriteln);
{$ENDIF}
@ -1760,25 +1772,28 @@ begin
end;
function TSimbaForm.DefaultScript: string;
var
x : TStringList;
begin
result := '';
Result := '';
case Interpreter of
interp_PS : begin
interp_PS, interp_LP: begin
Result := 'program new;' + LineEnding + 'begin' + LineEnding + 'end.' + LineEnding;
if FileExistsUTF8(SimbaForm.DefScriptPath) then
begin
x := TStringList.Create;
try
x.LoadFromFile(SimbaForm.DefScriptPath);
with TStringList.Create do
try
LoadFromFile(SimbaForm.DefScriptPath);
Result := Text;
finally
Free;
end;
except
mDebugLn('Couldn''t load default script file.');
end;
Result := x.Text;
end else
result := 'program new;'+LineEnding + 'begin'+LineEnding+'end.' + LineEnding;
end;
interp_RT : result := 'program untitled;' + LineEnding + lineEnding + 'interface' + LineEnding + LineEnding +
end;
interp_RT: Result := 'program untitled;' + LineEnding + lineEnding + 'interface' + LineEnding + LineEnding +
'implementation' + LineEnding + LineEnding + 'begin' + LineEnding + 'end.' + LineEnding;
end;
end;
@ -1835,7 +1850,7 @@ end;
procedure TSimbaForm.ActionCPascalExecute(Sender: TObject);
begin
Interpreter:= interp_CP;
Interpreter := interp_CP;
end;
procedure TSimbaForm.ActionCutExecute(Sender: TObject);
@ -1909,6 +1924,11 @@ begin
end;
end;
procedure TSimbaForm.ActionLapeExecute(Sender: TObject);
begin
{$IFDEF USE_LAPE}Interpreter := interp_LP;{$ENDIF}
end;
procedure TSimbaForm.ActionClearDebugExecute(Sender: TObject);
begin
Memo1.Clear;
@ -1950,7 +1970,7 @@ end;
procedure TSimbaForm.ActionPascalScriptExecute(Sender: TObject);
begin
Interpreter:= interp_PS;
Interpreter := interp_PS;
end;
procedure TSimbaForm.ActionPasteExecute(Sender: TObject);
@ -2363,6 +2383,9 @@ begin
end;
end;
SimbaForm.InitializeTMThread(t);
if (t = nil) then
Exit;
KillThread(t.ThreadID); { XXX: Why do we kill the thread again ? }
if (t is TPSThread) then
try
@ -2502,10 +2525,8 @@ begin
UpdateTitle;
{$IFNDEF USE_RUTIS}
MenuItemRUTIS.Enabled:=False;
{$ENDIF}
{$IFDEF USE_RUTIS}MenuItemRUTIS.Enabled := True;{$ENDIF}
{$IFDEF USE_LAPE}MenuItemLape.Enabled := True;{$ENDIF}
{$IFDEF USE_EXTENSIONS}ActionExtensions.Visible := True;{$ENDIF}
self.EndFormUpdate;
@ -3060,9 +3081,11 @@ begin
if (CurrScript <> nil) then
with CurrScript.Synedit do
if (Lines.text = DefaultScript) and not(CanUndo or CanRedo) then
UpdateCurrScript := true;
SetSetting('Settings/Interpreter/Type',Inttostr(AValue),true);
UpdateCurrScript := True;
SetSetting('Settings/Interpreter/Type', IntToStr(AValue), True);
UpdateInterpreter;
if UpdateCurrScript then
CurrScript.SynEdit.Lines.text := DefaultScript;
end;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,204 @@
unit main;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls, SynEdit, SynHighlighterPas,wrapfiles;
type
{ TfrmMain }
TfrmMain = class(TForm)
btnGo: TButton;
btnAdvanced: TButton;
pnlMain: TPanel;
Splitter1: TSplitter;
Splitter2: TSplitter;
eIn: TSynEdit;
eOut: TSynEdit;
eDebug: TSynEdit;
PasHL: TSynPasSyn;
procedure btnAdvancedClick(Sender: TObject);
procedure btnGoClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
procedure ConvertRT(Input, Dbg, Output : TStrings; procnames : TStrings = nil);
var
frmMain: TfrmMain;
implementation
uses
v_ideCodeParser;
{$R *.lfm}
{ TfrmMain }
procedure ConvertRT(Input, Dbg, Output : TStrings; procnames : TStrings = nil);
procedure Debug(s: string); overload;
begin
if (Trim(Output.Text) <> '') then
Dbg.Append(s)
else
Dbg.Text := s;
end;
procedure Debug(v: Variant); overload;
begin
Debug(string(v));
end;
procedure Write(s: string); overload;
begin
if (Trim(Output.Text) <> '') then
Output.Text := Output.Text + s
else
Output.Text := s;
end;
procedure Write(v: Variant); overload;
begin
Write(string(v));
end;
function FixName( str : string) : string;
begin
if (length(str) > 3) and (str[1] = 'p') and (str[2] = 's') and (str[3] = '_') then
result := Copy(str,4,length(str)-3)
else
result := str;
end;
function PtrName ( str : string) : String;
begin
debug(str);
if (length(str) > 1) and (str[1] in ['T','t']) then
result := 'P' + copy(str,2,length(str)-1)
else
result := 'P' + str;
debug(result);
end;
var
p: TCodeParser;
m: TMemoryStream;
a, b, c: TDeclarationArray;
i, ii, iii, pc: Integer;
s: string;
d: TDeclaration;
Fail: Boolean;
begin
p := TCodeParser.Create;
m := TMemoryStream.Create;
try
Output.BeginUpdate;
Output.Clear;
Dbg.BeginUpdate;
Dbg.Clear;
Input.SaveToStream(m);
try
p.Run(m);
except on E : Exception do
Debug(e.Message);
end;
a := p.Items.GetItemsOfClass(TciProcedureDeclaration);
Debug('Start converting '+IntToStr(Length(a))+' methods!');
for i := 0 to High(a) do
with TciProcedureDeclaration(a[i]) do
begin
if (Name = nil) then
begin
Debug('No name found, skipping..');
Continue;
end;
d := Items.GetFirstItemOfClass(TciReturnType);
if (d <> nil) then
begin
s := 'procedure Lape_'+FixName(Name.ShortText)+
'(const Params: PParamArray; const Result: Pointer);'+LineEnding+
'begin'+LineEnding+
' '+PtrName(d.ShortText)+'(Result)^ := ';
end else
begin
s := 'procedure Lape_'+FixName(Name.ShortText)+'(const Params: PParamArray);'+LineEnding+
'begin'+LineEnding+' ';
end;
s := s+Name.ShortText+'(';
Fail := False;
pc := 0;
b := GetParamDeclarations();
for ii := 0 to High(b) do
begin
d := b[ii].Items.GetFirstItemOfClass(TciParameterType);
if (d = nil) then
begin
Debug('No parameter type found in '+Name.ShortText+', skipping..');
Fail := True;
Break;
end;
c := b[ii].Items.GetItemsOfClass(TciParameterName);
if (Length(c) < 1) then
begin
Debug('No parameter names found in '+Name.ShortText+', skipping..');
Fail := True;
Break;
end;
for iii := 0 to High(c) do
begin
if (pc > 0) then
s := s+', ';
s := s+PtrName(d.ShortText)+'(Params^['+IntToStr(pc)+'])^';
Inc(pc);
end;
end;
if Fail then
Continue;
s := s+');'+LineEnding+'end;';
if (i > 0) then
s := LineEnding+s;
Write(s);
if procnames <> nil then
procnames.Add('AddGlobalFunc('#39 + CleanDeclaration + #39', @Lape_'+FixName(name.ShortText)+');')
else
Debug('Prog-name "AddGlobalFunc('#39 + CleanDeclaration + #39', @Lape_'+FixName(name.ShortText)+');"');
Debug('Done "'+Name.ShortText+'"!');
end;
finally
m.Free;
p.Free;
Output.EndUpdate;
Dbg.EndUpdate;
end;
Debug('Done :)');
end;
procedure TfrmMain.btnGoClick(Sender: TObject);
begin
ConvertRT(eIn.Lines,eDebug.Lines,eOut.Lines);
end;
procedure TfrmMain.btnAdvancedClick(Sender: TObject);
begin
WrapFilesForm.ShowModal;
end;
end.

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@ -0,0 +1,380 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<General>
<MainUnit Value="0"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<Icon Value="0"/>
<ActiveWindowIndexAtStart Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<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"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="SynEdit"/>
<MinVersion Major="1" Valid="True"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="22">
<Unit0>
<Filename Value="ruwa.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ruwa"/>
<UsageCount Value="24"/>
</Unit0>
<Unit1>
<Filename Value="main.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmMain"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="main"/>
<EditorIndex Value="0"/>
<WindowIndex Value="0"/>
<TopLine Value="34"/>
<CursorPos X="15" Y="32"/>
<UsageCount Value="24"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\..\Units\Misc\v_MiscFunctions.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="v_MiscFunctions"/>
<UsageCount Value="24"/>
</Unit2>
<Unit3>
<Filename Value="..\..\Units\Misc\ValistusDefines.inc"/>
<IsPartOfProject Value="True"/>
<UsageCount Value="24"/>
</Unit3>
<Unit4>
<Filename Value="..\..\Units\Misc\CastaliaPasLex.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="CastaliaPasLex"/>
<UsageCount Value="24"/>
</Unit4>
<Unit5>
<Filename Value="..\..\Units\Misc\CastaliaPasLexTypes.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="CastaliaPasLexTypes"/>
<UsageCount Value="24"/>
</Unit5>
<Unit6>
<Filename Value="..\..\Units\Misc\CastaliaSimplePasPar.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="CastaliaSimplePasPar"/>
<UsageCount Value="24"/>
</Unit6>
<Unit7>
<Filename Value="..\..\Units\Misc\CastaliaSimplePasParTypes.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="CastaliaSimplePasParTypes"/>
<UsageCount Value="24"/>
</Unit7>
<Unit8>
<Filename Value="..\..\Units\Misc\v_autocompleteform.pas"/>
<UnitName Value="v_autocompleteform"/>
<UsageCount Value="20"/>
</Unit8>
<Unit9>
<Filename Value="..\..\Units\Misc\v_Constants.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="v_Constants"/>
<UsageCount Value="24"/>
</Unit9>
<Unit10>
<Filename Value="..\..\Units\Misc\v_ideCodeInsight.pas"/>
<UnitName Value="v_ideCodeInsight"/>
<WindowIndex Value="0"/>
<TopLine Value="239"/>
<CursorPos X="35" Y="286"/>
<UsageCount Value="20"/>
</Unit10>
<Unit11>
<Filename Value="..\..\Units\Misc\v_ideCodeParser.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="v_ideCodeParser"/>
<EditorIndex Value="8"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="8" Y="8"/>
<UsageCount Value="24"/>
<Loaded Value="True"/>
</Unit11>
<Unit12>
<Filename Value="C:\FPC\Source\rtl\win\sysutils.pp"/>
<UnitName Value="sysutils"/>
<WindowIndex Value="0"/>
<TopLine Value="567"/>
<CursorPos X="29" Y="596"/>
<UsageCount Value="10"/>
</Unit12>
<Unit13>
<Filename Value="C:\LazSVN\components\synedit\synedit.pp"/>
<UnitName Value="SynEdit"/>
<WindowIndex Value="0"/>
<TopLine Value="6433"/>
<CursorPos X="34" Y="6451"/>
<UsageCount Value="10"/>
</Unit13>
<Unit14>
<Filename Value="C:\FPC\Source\rtl\win32\system.pp"/>
<UnitName Value="System"/>
<WindowIndex Value="0"/>
<TopLine Value="17"/>
<CursorPos X="2" Y="35"/>
<UsageCount Value="10"/>
</Unit14>
<Unit15>
<Filename Value="wrapfiles.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="WrapFilesForm"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="wrapfiles"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="44"/>
<CursorPos X="29" Y="48"/>
<UsageCount Value="24"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit15>
<Unit16>
<Filename Value="C:\lazarus\lcl\fileutil.pas"/>
<UnitName Value="FileUtil"/>
<EditorIndex Value="6"/>
<WindowIndex Value="0"/>
<TopLine Value="23"/>
<CursorPos X="10" Y="49"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit16>
<Unit17>
<Filename Value="C:\lazarus\lcl\include\fileutil.inc"/>
<EditorIndex Value="7"/>
<WindowIndex Value="0"/>
<TopLine Value="379"/>
<CursorPos X="3" Y="391"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit17>
<Unit18>
<Filename Value="C:\FPC\FPCCheckout\rtl\objpas\classes\classesh.inc"/>
<EditorIndex Value="2"/>
<WindowIndex Value="0"/>
<TopLine Value="633"/>
<CursorPos X="3" Y="659"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit18>
<Unit19>
<Filename Value="C:\FPC\FPCCheckout\rtl\objpas\classes\stringl.inc"/>
<EditorIndex Value="5"/>
<WindowIndex Value="0"/>
<TopLine Value="592"/>
<CursorPos X="3" Y="597"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit19>
<Unit20>
<Filename Value="C:\FPC\FPCCheckout\rtl\objpas\classes\streams.inc"/>
<EditorIndex Value="3"/>
<WindowIndex Value="0"/>
<TopLine Value="450"/>
<CursorPos X="20" Y="466"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="C:\FPC\FPCCheckout\rtl\objpas\sysutils\filutilh.inc"/>
<EditorIndex Value="4"/>
<WindowIndex Value="0"/>
<TopLine Value="42"/>
<CursorPos X="18" Y="64"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit21>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="wrapfiles.pas"/>
<Caret Line="43" Column="1" TopLine="25"/>
</Position1>
<Position2>
<Filename Value="wrapfiles.pas"/>
<Caret Line="44" Column="1" TopLine="26"/>
</Position2>
<Position3>
<Filename Value="wrapfiles.pas"/>
<Caret Line="42" Column="1" TopLine="28"/>
</Position3>
<Position4>
<Filename Value="wrapfiles.pas"/>
<Caret Line="41" Column="1" TopLine="27"/>
</Position4>
<Position5>
<Filename Value="wrapfiles.pas"/>
<Caret Line="43" Column="1" TopLine="29"/>
</Position5>
<Position6>
<Filename Value="wrapfiles.pas"/>
<Caret Line="44" Column="1" TopLine="30"/>
</Position6>
<Position7>
<Filename Value="wrapfiles.pas"/>
<Caret Line="46" Column="1" TopLine="32"/>
</Position7>
<Position8>
<Filename Value="wrapfiles.pas"/>
<Caret Line="51" Column="15" TopLine="35"/>
</Position8>
<Position9>
<Filename Value="wrapfiles.pas"/>
<Caret Line="52" Column="15" TopLine="36"/>
</Position9>
<Position10>
<Filename Value="wrapfiles.pas"/>
<Caret Line="37" Column="8" TopLine="23"/>
</Position10>
<Position11>
<Filename Value="wrapfiles.pas"/>
<Caret Line="71" Column="31" TopLine="56"/>
</Position11>
<Position12>
<Filename Value="main.pas"/>
<Caret Line="90" Column="10" TopLine="39"/>
</Position12>
<Position13>
<Filename Value="main.pas"/>
<Caret Line="49" Column="11" TopLine="23"/>
</Position13>
<Position14>
<Filename Value="main.pas"/>
<Caret Line="88" Column="14" TopLine="48"/>
</Position14>
<Position15>
<Filename Value="main.pas"/>
<Caret Line="90" Column="11" TopLine="64"/>
</Position15>
<Position16>
<Filename Value="main.pas"/>
<Caret Line="170" Column="46" TopLine="128"/>
</Position16>
<Position17>
<Filename Value="wrapfiles.pas"/>
<Caret Line="72" Column="14" TopLine="27"/>
</Position17>
<Position18>
<Filename Value="wrapfiles.pas"/>
<Caret Line="46" Column="23" TopLine="27"/>
</Position18>
<Position19>
<Filename Value="wrapfiles.pas"/>
<Caret Line="50" Column="20" TopLine="32"/>
</Position19>
<Position20>
<Filename Value="C:\FPC\FPCCheckout\rtl\objpas\classes\stringl.inc"/>
<Caret Line="625" Column="14" TopLine="608"/>
</Position20>
<Position21>
<Filename Value="wrapfiles.pas"/>
<Caret Line="48" Column="48" TopLine="33"/>
</Position21>
<Position22>
<Filename Value="wrapfiles.pas"/>
<Caret Line="54" Column="1" TopLine="52"/>
</Position22>
<Position23>
<Filename Value="wrapfiles.pas"/>
<Caret Line="83" Column="110" TopLine="37"/>
</Position23>
<Position24>
<Filename Value="wrapfiles.pas"/>
<Caret Line="95" Column="18" TopLine="46"/>
</Position24>
<Position25>
<Filename Value="wrapfiles.pas"/>
<Caret Line="86" Column="61" TopLine="49"/>
</Position25>
<Position26>
<Filename Value="wrapfiles.pas"/>
<Caret Line="101" Column="19" TopLine="55"/>
</Position26>
<Position27>
<Filename Value="C:\FPC\FPCCheckout\rtl\objpas\classes\streams.inc"/>
<Caret Line="466" Column="20" TopLine="450"/>
</Position27>
<Position28>
<Filename Value="wrapfiles.pas"/>
<Caret Line="102" Column="21" TopLine="55"/>
</Position28>
<Position29>
<Filename Value="wrapfiles.pas"/>
<Caret Line="108" Column="35" TopLine="63"/>
</Position29>
<Position30>
<Filename Value="wrapfiles.pas"/>
<Caret Line="99" Column="56" TopLine="63"/>
</Position30>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="ruwa"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)\;..\..\Units\Misc\"/>
<OtherUnitFiles Value="..\..\Units\Misc\"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="4">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
<Item4>
<Name Value="ESyntaxError"/>
</Item4>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,22 @@
program ruwa;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, main, v_MiscFunctions, CastaliaPasLex, CastaliaPasLexTypes,
CastaliaSimplePasPar, CastaliaSimplePasParTypes,
v_Constants, v_ideCodeParser, wrapfiles;
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TfrmMain, frmMain);
Application.CreateForm(TWrapFilesForm, WrapFilesForm);
Application.Run;
end.

View File

@ -0,0 +1,94 @@
object WrapFilesForm: TWrapFilesForm
Left = 429
Height = 398
Top = 234
Width = 652
Caption = 'WrapFilesForm'
ClientHeight = 398
ClientWidth = 652
Constraints.MinHeight = 398
Constraints.MinWidth = 652
OnCreate = FormCreate
LCLVersion = '0.9.29'
object FileButton: TButton
Left = 16
Height = 25
Top = 16
Width = 75
Caption = 'Select files'
OnClick = FileButtonClick
TabOrder = 0
end
object FileBox: TListBox
Left = 16
Height = 220
Top = 56
Width = 616
Anchors = [akTop, akLeft, akRight, akBottom]
ItemHeight = 0
TabOrder = 1
end
object SaveDirEdit: TDirectoryEdit
Left = 192
Height = 21
Top = 20
Width = 152
ShowHidden = False
ButtonWidth = 23
NumGlyphs = 0
MaxLength = 0
TabOrder = 2
end
object SaveDirLabel: TLabel
Left = 104
Height = 14
Top = 20
Width = 78
Caption = 'Save directory: '
ParentColor = False
end
object wrpBtn: TButton
Left = 568
Height = 25
Top = 16
Width = 75
Caption = 'Convert'
OnClick = wrpBtnClick
TabOrder = 3
end
object dbgMemo: TMemo
Left = 16
Height = 100
Top = 287
Width = 616
Anchors = [akRight, akBottom]
TabOrder = 4
end
object FileNameEdit1: TFileNameEdit
Left = 448
Height = 21
Top = 20
Width = 80
DialogOptions = []
FilterIndex = 0
HideDirectories = False
ButtonWidth = 23
NumGlyphs = 0
MaxLength = 0
TabOrder = 5
end
object Label1: TLabel
Left = 383
Height = 14
Top = 25
Width = 57
Caption = 'MethodFile:'
ParentColor = False
end
object FileDialog: TOpenDialog
Filter = 'Include files (*.inc)|*.inc|All files (*.*)|*.*'
Options = [ofAllowMultiSelect, ofFileMustExist, ofEnableSizing, ofViewDetail]
left = 32
top = 56
end
end

View File

@ -0,0 +1,127 @@
unit wrapfiles;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
EditBtn;
type
{ TWrapFilesForm }
TWrapFilesForm = class(TForm)
dbgMemo: TMemo;
FileNameEdit1: TFileNameEdit;
Label1: TLabel;
wrpBtn: TButton;
SaveDirEdit: TDirectoryEdit;
FileButton: TButton;
FileBox: TListBox;
FileDialog: TOpenDialog;
SaveDirLabel: TLabel;
procedure FileButtonClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure wrpBtnClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
WrapFilesForm: TWrapFilesForm;
implementation
uses
Main;
{$R *.lfm}
{ TWrapFilesForm }
procedure TWrapFilesForm.FileButtonClick(Sender: TObject);
begin
if FileDialog.Execute then
begin
SaveDirEdit.Directory := ExtractFileDir(FileDialog.FileName);
FileBox.Items.AddStrings(FileDialog.Files);
end;
end;
procedure TWrapFilesForm.FormCreate(Sender: TObject);
begin
end;
procedure TWrapFilesForm.wrpBtnClick(Sender: TObject);
procedure dbg(s : string);
begin
dbgMemo.Lines.Add(s);
end;
var
i : integer;
Input, Output,Procnames : TStringList;
NewFile : string;
YesToAll, NoToAll : boolean;
begin
YesToAll:= false;
NoToAll:= false;
if not DirectoryExists(SaveDirEdit.Directory) then
begin
dbg(format('Dir %s does not exist',[SaveDirEdit.Directory]));
exit;
end;
if FileBox.Items.Count < 1 then
begin
dbg('No files loaded');
exit;
end;
Procnames := TStringList.Create;
for i := 0 to FileBox.Items.Count - 1 do
begin
if not FileExists(filebox.items[i]) then
begin
dbg(format('File[%s] does not exist',[FileBox.items[i]]));
continue;
end;
NewFile := SaveDirEdit.Directory + DirectorySeparator + ExtractFileName(FileBox.Items[i]);
if not YesToAll and FileExists(NewFile) then
begin
if NoToAll then
Continue;
case MessageDlg('File already exists',Format('Do you want to overwrite the file %s',[NewFile]),
mtConfirmation,[mbYes,mbYesToAll,mbNo,mbNoToAll],0) of
mrNo : Continue;
mrNoToAll : begin
NoToAll:= True;
Continue;
end;
mrYesToAll : YesToAll:= true;
end;
dbg(BoolToStr(YesToAll,true));
end;
dbg(NewFile);
try
Input := TStringList.Create;
Input.LoadFromFile(filebox.items[i]);
Output := TStringList.Create;
ConvertRT(Input,dbgMemo.Lines,Output,Procnames);
Output.SaveToFile(NewFile);
Input.free;
Output.free;
except
dbg('Something went wrong');
end;
end;
dbg(Procnames.Text);
if FileNameEdit1.Text <> '' then
Procnames.SaveToFile(FileNameEdit1.text);
Procnames.Free;
end;
end.

View File

@ -0,0 +1,259 @@
procedure Lape_CreateBitmapString(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_CreateBitmapString(Pinteger(Params^[0])^);
end;
procedure Lape_GetMufasaBitmap(const Params: PParamArray; const Result: Pointer);
begin
PMufasaBitmap(Result)^ := ps_GetMufasaBitmap(Pinteger(Params^[0])^);
end;
procedure Lape_CreateBitmap(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_CreateBitmap(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_FreeBitmap(const Params: PParamArray);
begin
ps_FreeBitmap(Pinteger(Params^[0])^);
end;
procedure Lape_SaveBitmap(const Params: PParamArray);
begin
ps_SaveBitmap(Pinteger(Params^[0])^, Pstring(Params^[1])^);
end;
procedure Lape_BitmapFromString(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_BitmapFromString(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pstring(Params^[2])^);
end;
procedure Lape_LoadBitmap(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_LoadBitmap(PString(Params^[0])^);
end;
procedure Lape_SetBitmapSize(const Params: PParamArray);
begin
ps_SetBitmapSize(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^);
end;
procedure Lape_StretchBitmapResize(const Params: PParamArray);
begin
ps_StretchBitmapResize(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^);
end;
procedure Lape_GetBitmapSize(const Params: PParamArray);
begin
ps_GetBitmapSize(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^);
end;
procedure Lape_SetBitmapName(const Params: PParamArray);
begin
ps_SetBitmapName(Pinteger(Params^[0])^, Pstring(Params^[1])^);
end;
procedure Lape_CreateMirroredBitmap(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_CreateMirroredBitmap(Pinteger(Params^[0])^);
end;
procedure Lape_CreateMirroredBitmapEx(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_CreateMirroredBitmapEx(Pinteger(Params^[0])^, PBmpMirrorStyle(Params^[1])^);
end;
procedure Lape_FastGetPixel(const Params: PParamArray; const Result: Pointer);
begin
PLongWord(Result)^ := ps_FastGetPixel(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^);
end;
procedure Lape_FastGetPixels(const Params: PParamArray; const Result: Pointer);
begin
PIntegerArray(Result)^ := ps_FastGetPixels(Pinteger(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_GetBitmapAreaColors(const Params: PParamArray; const Result: Pointer);
begin
P2DIntArray(Result)^ := ps_GetBitmapAreaColors(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^);
end;
procedure Lape_FastSetPixel(const Params: PParamArray);
begin
ps_FastSetPixel(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^, PColor(Params^[3])^);
end;
procedure Lape_FastSetPixels(const Params: PParamArray);
begin
ps_FastSetPixels(Pinteger(Params^[0])^, PPointArray(Params^[1])^, PIntegerArray(Params^[2])^);
end;
procedure Lape_DrawTPABitmap(const Params: PParamArray);
begin
ps_DrawTPABitmap(Pinteger(Params^[0])^, PPointArray(Params^[1])^, Pinteger(Params^[2])^);
end;
procedure Lape_DrawATPABitmap(const Params: PParamArray);
begin
ps_DrawATPABitmap(Pinteger(Params^[0])^, P2DPointArray(Params^[1])^);
end;
procedure Lape_DrawATPABitmapEx(const Params: PParamArray);
begin
ps_DrawATPABitmapEx(Pinteger(Params^[0])^, P2DPointArray(Params^[1])^, PIntegerArray(Params^[2])^);
end;
procedure Lape_FastDrawClear(const Params: PParamArray);
begin
ps_FastDrawClear(Pinteger(Params^[0])^, PColor(Params^[1])^);
end;
procedure Lape_DrawBitmap(const Params: PParamArray);
begin
ps_DrawBitmap(PInteger(Params^[0])^, PCanvas(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^);
end;
procedure Lape_FastDrawTransparent(const Params: PParamArray);
begin
ps_FastDrawTransparent(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^);
end;
procedure Lape_SetTransparentColor(const Params: PParamArray);
begin
ps_SetTransparentColor(Pinteger(Params^[0])^, PColor(Params^[1])^);
end;
procedure Lape_GetTransparentColor(const Params: PParamArray; const Result: Pointer);
begin
PColor(Result)^ := ps_GetTransparentColor(Pinteger(Params^[0])^);
end;
procedure Lape_FastReplaceColor(const Params: PParamArray);
begin
ps_FastReplaceColor(PInteger(Params^[0])^, PColor(Params^[1])^, PColor(Params^[2])^);
end;
procedure Lape_CopyClientToBitmap(const Params: PParamArray);
begin
ps_CopyClientToBitmap(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^);
end;
procedure Lape_BitmapFromClient(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_BitmapFromClient(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^);
end;
procedure Lape_FindBitmap(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindBitmap(Pinteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^);
end;
procedure Lape_FindBitmapIn(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindBitmapIn(Pinteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^);
end;
procedure Lape_FindBitmapToleranceIn(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindBitmapToleranceIn(Pinteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^, PInteger(Params^[7])^);
end;
procedure Lape_FindBitmapSpiral(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindBitmapSpiral(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^);
end;
procedure Lape_FindBitmapsSpiralTolerance(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindBitmapsSpiralTolerance(Pinteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PPointArray(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^, PInteger(Params^[7])^, PInteger(Params^[8])^);
end;
procedure Lape_FindBitmapSpiralTolerance(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindBitmapSpiralTolerance(Pinteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, Pinteger(Params^[3])^, Pinteger(Params^[4])^, Pinteger(Params^[5])^, Pinteger(Params^[6])^, Pinteger(Params^[7])^);
end;
procedure Lape_RotateBitmap(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_RotateBitmap(PInteger(Params^[0])^, PExtended(Params^[1])^);
end;
procedure Lape_Desaturate(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_Desaturate(Pinteger(Params^[0])^);
end;
procedure Lape_InvertBitmap(const Params: PParamArray);
begin
ps_InvertBitmap(Pinteger(Params^[0])^);
end;
procedure Lape_CopyBitmap(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_CopyBitmap(Pinteger(Params^[0])^);
end;
procedure Lape_GreyScaleBitmap(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_GreyScaleBitmap(Pinteger(Params^[0])^);
end;
procedure Lape_BrightnessBitmap(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_BrightnessBitmap(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_ContrastBitmap(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_ContrastBitmap(Pinteger(Params^[0])^, Pextended(Params^[1])^);
end;
procedure Lape_PosterizeBitmap(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_PosterizeBitmap(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_CreateMaskFromBitmap(const Params: PParamArray; const Result: Pointer);
begin
PMask(Result)^ := ps_CreateMaskFromBitmap(Pinteger(Params^[0])^);
end;
procedure Lape_FindMaskTolerance(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindMaskTolerance(PMask(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^, PInteger(Params^[7])^, PInteger(Params^[8])^);
end;
procedure Lape_FindBitmapMaskTolerance(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindBitmapMaskTolerance(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^, PInteger(Params^[7])^, PInteger(Params^[8])^);
end;
procedure Lape_FindDeformedBitmapToleranceIn(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindDeformedBitmapToleranceIn(Pinteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^, PInteger(Params^[7])^, PInteger(Params^[8])^, PBoolean(Params^[9])^, PExtended(Params^[10])^);
end;
procedure Lape_RectangleBitmap(const Params: PParamArray);
begin
ps_RectangleBitmap(Pinteger(Params^[0])^, PBox(Params^[1])^, PColor(Params^[2])^);
end;
procedure Lape_FloodFillBitmap(const Params: PParamArray);
begin
ps_FloodFillBitmap(Pinteger(Params^[0])^, PPoint(Params^[1])^, PColor(Params^[2])^, PColor(Params^[3])^);
end;
procedure Lape_ConvoluteBitmap(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_ConvoluteBitmap(Pinteger(Params^[0])^, P2DExtendedArray(Params^[1])^);
end;
procedure Lape_CalculatePixelShift(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_CalculatePixelShift(PInteger(Params^[0])^, PInteger(Params^[1])^, PBox(Params^[2])^);
end;
procedure Lape_CalculatePixelTolerance(const Params: PParamArray; const Result: Pointer);
begin
Pextended(Result)^ := ps_CalculatePixelTolerance(PInteger(Params^[0])^, PInteger(Params^[1])^, PBox(Params^[2])^, Pinteger(Params^[3])^);
end;

View File

@ -0,0 +1,104 @@
procedure Lape_GetColor(const Params: PParamArray; const Result: Pointer);
begin
PColor(Result)^ := ps_GetColor(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_GetColorsWrap(const Params: PParamArray);
begin
ps_GetColorsWrap(PPointArray(Params^[0])^, PIntegerArray(Params^[1])^);
end;
procedure Lape_GetColors(const Params: PParamArray; const Result: Pointer);
begin
PIntegerArray(Result)^ := ps_GetColors(PPointArray(Params^[0])^);
end;
procedure Lape_findcolor(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_findcolor(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^, Pinteger(Params^[3])^, Pinteger(Params^[4])^, Pinteger(Params^[5])^, Pinteger(Params^[6])^);
end;
procedure Lape_findcolortoleranceOptimised(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_findcolortoleranceOptimised(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^, Pinteger(Params^[3])^, Pinteger(Params^[4])^, Pinteger(Params^[5])^, Pinteger(Params^[6])^, Pinteger(Params^[7])^);
end;
procedure Lape_findcolortolerance(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_findcolortolerance(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^, Pinteger(Params^[3])^, Pinteger(Params^[4])^, Pinteger(Params^[5])^, Pinteger(Params^[6])^, Pinteger(Params^[7])^);
end;
procedure Lape_FindColors(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindColors(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^);
end;
procedure Lape_SetColorToleranceSpeed(const Params: PParamArray);
begin
ps_SetColorToleranceSpeed(PInteger(Params^[0])^);
end;
procedure Lape_GetToleranceSpeed(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_GetToleranceSpeed();
end;
procedure Lape_SetToleranceSpeed2Modifiers(const Params: PParamArray);
begin
ps_SetToleranceSpeed2Modifiers(PExtended(Params^[0])^, PExtended(Params^[1])^);
end;
procedure Lape_GetToleranceSpeed2Modifiers(const Params: PParamArray);
begin
ps_GetToleranceSpeed2Modifiers(PExtended(Params^[0])^, PExtended(Params^[1])^);
end;
procedure Lape_SimilarColors(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_SimilarColors(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^);
end;
procedure Lape_CountColor(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_CountColor(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^);
end;
procedure Lape_CountColorTolerance(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_CountColorTolerance(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^);
end;
procedure Lape_FindColorsToleranceOptimised(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindColorsToleranceOptimised(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^);
end;
procedure Lape_FindColorsTolerance(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindColorsTolerance(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^);
end;
procedure Lape_FindColorSpiral(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindColorSpiral(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^);
end;
procedure Lape_FindColorSpiralTolerance(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindColorSpiralTolerance(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^, PInteger(Params^[7])^);
end;
procedure Lape_FindColorsSpiralTolerance(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_FindColorsSpiralTolerance(PInteger(Params^[0])^, PInteger(Params^[1])^, PPointArray(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^, PInteger(Params^[7])^, PInteger(Params^[8])^);
end;
procedure Lape_FindColoredArea(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindColoredArea(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^, PInteger(Params^[7])^);
end;
procedure Lape_FindColoredAreaTolerance(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindColoredAreaTolerance(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^, PInteger(Params^[7])^, PInteger(Params^[8])^);
end;

View File

@ -0,0 +1,4 @@
procedure Lape_ColorToRGB(const Params: PParamArray);
begin
ps_ColorToRGB(Pinteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^);
end;

View File

@ -0,0 +1,4 @@
procedure Lape_haval(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_haval(Pstring(Params^[0])^);
end;

View File

@ -0,0 +1,79 @@
procedure Lape_FindDTM(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindDTM(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^);
end;
procedure Lape_FindDTMs(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindDTMs(PInteger(Params^[0])^, PPointArray(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^);
end;
procedure Lape_FindDTMRotatedAlternating(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindDTMRotatedAlternating(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^, PExtended(Params^[7])^, PExtended(Params^[8])^, PExtended(Params^[9])^, PExtended(Params^[10])^);
end;
procedure Lape_FindDTMRotatedSE(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindDTMRotatedSE(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^, PExtended(Params^[7])^, PExtended(Params^[8])^, PExtended(Params^[9])^, PExtended(Params^[10])^);
end;
procedure Lape_FindDTMsRotatedAlternating(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindDTMsRotatedAlternating(PInteger(Params^[0])^, PPointArray(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PExtended(Params^[6])^, PExtended(Params^[7])^, PExtended(Params^[8])^, P2DExtendedArray(Params^[9])^);
end;
procedure Lape_FindDTMsRotatedSE(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindDTMsRotatedSE(PInteger(Params^[0])^, PPointArray(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^, PInteger(Params^[5])^, PExtended(Params^[6])^, PExtended(Params^[7])^, PExtended(Params^[8])^, P2DExtendedArray(Params^[9])^);
end;
procedure Lape_SetDTMName(const Params: PParamArray);
begin
ps_SetDTMName(Pinteger(Params^[0])^, Pstring(Params^[1])^);
end;
procedure Lape_DTMFromString(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_DTMFromString(PString(Params^[0])^);
end;
procedure Lape_FreeDTM(const Params: PParamArray);
begin
ps_FreeDTM(PInteger(Params^[0])^);
end;
procedure Lape_GetDTM(const Params: PParamArray; const Result: Pointer);
begin
PMDTM(Result)^ := ps_GetDTM(PInteger(Params^[0])^);
end;
procedure Lape_AddTSDTM(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_AddTSDTM(PSDTM(Params^[0])^);
end;
procedure Lape_AddDTM(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_AddDTM(PMDTM(Params^[0])^);
end;
procedure Lape_PrintDTM(const Params: PParamArray);
begin
ps_PrintDTM(PMDTM(Params^[0])^);
end;
procedure Lape_MDTMToSDTM(const Params: PParamArray; const Result: Pointer);
begin
PSDTM(Result)^ := ps_MDTMToSDTM(PMDTM(Params^[0])^);
end;
procedure Lape_SDTMToMDTM(const Params: PParamArray; const Result: Pointer);
begin
PMDTM(Result)^ := ps_SDTMToMDTM(PSDTM(Params^[0])^);
end;
procedure Lape_CreateDTMPoint(const Params: PParamArray; const Result: Pointer);
begin
PMDTMPoint(Result)^ := ps_CreateDTMPoint(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^, Pinteger(Params^[3])^, Pinteger(Params^[4])^, Pboolean(Params^[5])^);
end;

View File

@ -0,0 +1,64 @@
procedure Lape_ext_UnTar(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ext_UnTar(Pstring(Params^[0])^, PStringArray(Params^[1])^);
end;
procedure Lape_ext_UnTarEx(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ext_UnTarEx(Pstring(Params^[0])^, Pstring(Params^[1])^, Pboolean(Params^[2])^);
end;
procedure Lape_ext_DecompressBZip2(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ext_DecompressBZip2(Pstring(Params^[0])^, Pstring(Params^[1])^, PCardinal(Params^[2])^);
end;
procedure Lape_ext_GetPage(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ext_GetPage(Pstring(Params^[0])^);
end;
procedure Lape_ext_MessageDlg(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ext_MessageDlg(Pstring(Params^[0])^, Pstring(Params^[1])^, PMsgDlgType(Params^[2])^, PMsgDlgButtons(Params^[3])^, PLongint(Params^[4])^);
end;
procedure Lape_ext_SDTMToMDTM(const Params: PParamArray; const Result: Pointer);
begin
PMDTM(Result)^ := ext_SDTMToMDTM(PSDTM(Params^[0])^);
end;
procedure Lape_ext_InputQuery(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ext_InputQuery(PString(Params^[0])^, PString(Params^[1])^, PString(Params^[2])^);
end;
procedure Lape_ext_ScriptText(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ext_ScriptText();
end;
procedure Lape_ext_GetSelectedText(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ext_GetSelectedText();
end;
procedure Lape_ext_OpenScript(const Params: PParamArray);
begin
ext_OpenScript(Pstring(Params^[0])^, Pstring(Params^[1])^, Pboolean(Params^[2])^);
end;
procedure Lape_ext_OpenScriptEx(const Params: PParamArray);
begin
ext_OpenScriptEx(Pstring(Params^[0])^, Pboolean(Params^[1])^);
end;
procedure Lape_ext_GetPageEx(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ext_GetPageEx(Pstring(Params^[0])^, Pstring(Params^[1])^, Pstring(Params^[2])^);
end;
procedure Lape_ext_GetJSONValue(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ext_GetJSONValue(Pstring(Params^[0])^, Pstring(Params^[1])^);
end;

View File

@ -0,0 +1,89 @@
procedure Lape_CreateFile(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_CreateFile(Pstring(Params^[0])^);
end;
procedure Lape_OpenFile(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_OpenFile(Pstring(Params^[0])^, PBoolean(Params^[1])^);
end;
procedure Lape_RewriteFile(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_RewriteFile(Pstring(Params^[0])^, PBoolean(Params^[1])^);
end;
procedure Lape_AppendFile(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_AppendFile(Pstring(Params^[0])^);
end;
procedure Lape_CloseFile(const Params: PParamArray);
begin
ps_CloseFile(PInteger(Params^[0])^);
end;
procedure Lape_EndOfFile(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_EndOfFile(PInteger(Params^[0])^);
end;
procedure Lape_FileSize(const Params: PParamArray; const Result: Pointer);
begin
PLongInt(Result)^ := ps_FileSize(PInteger(Params^[0])^);
end;
procedure Lape_ReadFileString(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_ReadFileString(PInteger(Params^[0])^, Pstring(Params^[1])^, PInteger(Params^[2])^);
end;
procedure Lape_WriteFileString(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_WriteFileString(PInteger(Params^[0])^, Pstring(Params^[1])^);
end;
procedure Lape_SetFileCharPointer(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_SetFileCharPointer(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^);
end;
procedure Lape_FilePointerPos(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_FilePointerPos(PInteger(Params^[0])^);
end;
procedure Lape_FileExists(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FileExists(Pstring(Params^[0])^);
end;
procedure Lape_DirectoryExists(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_DirectoryExists(Pstring(Params^[0])^);
end;
procedure Lape_CreateDirectory(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_CreateDirectory(Pstring(Params^[0])^);
end;
procedure Lape_ForceDirectores(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_ForceDirectores(Pstring(Params^[0])^);
end;
procedure Lape_GetFiles(const Params: PParamArray; const Result: Pointer);
begin
PStringArray(Result)^ := ps_GetFiles(Pstring(Params^[0])^, Pstring(Params^[1])^);
end;
procedure Lape_GetDirectories(const Params: PParamArray; const Result: Pointer);
begin
PStringArray(Result)^ := ps_GetDirectories(Pstring(Params^[0])^);
end;
procedure Lape_WriteINI(const Params: PParamArray);
begin
ps_WriteINI(Pstring(Params^[0])^, Pstring(Params^[1])^, Pstring(Params^[2])^, Pstring(Params^[3])^);
end;

View File

@ -0,0 +1,124 @@
procedure Lape_OpenWebPage(const Params: PParamArray);
begin
ps_OpenWebPage(Pstring(Params^[0])^);
end;
procedure Lape_GetPage(const Params: PParamArray; const Result: Pointer);
begin
PString(Result)^ := ps_GetPage(PString(Params^[0])^);
end;
procedure Lape_InitializeHTTPClient(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_InitializeHTTPClient(PBoolean(Params^[0])^);
end;
procedure Lape_FreeHTTPClient(const Params: PParamArray);
begin
ps_FreeHTTPClient(PInteger(Params^[0])^);
end;
procedure Lape_GetHTTPPage(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_GetHTTPPage(PInteger(Params^[0])^, Pstring(Params^[1])^);
end;
procedure Lape_SetHTTPUserAgent(const Params: PParamArray);
begin
ps_SetHTTPUserAgent(PInteger(Params^[0])^, Pstring(Params^[1])^);
end;
procedure Lape_PostHTTPPage(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_PostHTTPPage(PInteger(Params^[0])^, Pstring(Params^[1])^, Pstring(Params^[2])^);
end;
procedure Lape_PostHTTPPageEx(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_PostHTTPPageEx(PInteger(Params^[0])^, Pstring(Params^[1])^);
end;
procedure Lape_ClearPostData(const Params: PParamArray);
begin
ps_ClearPostData(PInteger(Params^[0])^);
end;
procedure Lape_AddPostVariable(const Params: PParamArray);
begin
ps_AddPostVariable(PInteger(Params^[0])^, Pstring(Params^[1])^, Pstring(Params^[2])^);
end;
procedure Lape_GetRawHeaders(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_GetRawHeaders(PInteger(Params^[0])^);
end;
procedure Lape_SetProxy(const Params: PParamArray);
begin
ps_SetProxy(PInteger(Params^[0])^, PString(Params^[1])^, PString(Params^[2])^);
end;
procedure Lape_RecvSocketStr(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_RecvSocketStr(Pinteger(Params^[0])^);
end;
procedure Lape_RecvSocket(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_RecvSocket(Pinteger(Params^[0])^);
end;
procedure Lape_RecvSocketEx(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_RecvSocketEx(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_SendSocket(const Params: PParamArray);
begin
ps_SendSocket(Pinteger(Params^[0])^, Pstring(Params^[1])^);
end;
procedure Lape_ConnectSocket(const Params: PParamArray);
begin
ps_ConnectSocket(Pinteger(Params^[0])^, Pstring(Params^[1])^, Pstring(Params^[2])^);
end;
procedure Lape_CloseSocket(const Params: PParamArray);
begin
ps_CloseSocket(Pinteger(Params^[0])^);
end;
procedure Lape_SetSocketTimeout(const Params: PParamArray);
begin
ps_SetSocketTimeout(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_BindSocket(const Params: PParamArray);
begin
ps_BindSocket(Pinteger(Params^[0])^, Pstring(Params^[1])^, Pstring(Params^[2])^);
end;
procedure Lape_ListenSocket(const Params: PParamArray);
begin
ps_ListenSocket(Pinteger(Params^[0])^);
end;
procedure Lape_AcceptSocket(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_AcceptSocket(Pinteger(Params^[0])^);
end;
procedure Lape_SocketInfo(const Params: PParamArray);
begin
ps_SocketInfo(Pinteger(Params^[0])^, Pstring(Params^[1])^, Pstring(Params^[2])^);
end;
procedure Lape_CreateSocket(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_CreateSocket();
end;
procedure Lape_FreeSocket(const Params: PParamArray);
begin
ps_FreeSocket(Pinteger(Params^[0])^);
end;

View File

@ -0,0 +1,29 @@
procedure Lape_KeyDown(const Params: PParamArray);
begin
ps_KeyDown(PWord(Params^[0])^);
end;
procedure Lape_KeyUp(const Params: PParamArray);
begin
ps_KeyUp(PWord(Params^[0])^);
end;
procedure Lape_SendKeys(const Params: PParamArray);
begin
ps_SendKeys(Pstring(Params^[0])^);
end;
procedure Lape_PressKey(const Params: PParamArray);
begin
ps_PressKey(PWord(Params^[0])^);
end;
procedure Lape_isKeyDown(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_isKeyDown(PWord(Params^[0])^);
end;
procedure Lape_GetKeyCode(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_GetKeyCode(Pchar(Params^[0])^);
end;

View File

@ -0,0 +1,114 @@
procedure Lape_round(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_round(Pextended(Params^[0])^);
end;
procedure Lape_iAbs(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_iAbs(Pinteger(Params^[0])^);
end;
procedure Lape_ceil(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_ceil(Pextended(Params^[0])^);
end;
procedure Lape_pow(const Params: PParamArray; const Result: Pointer);
begin
Pextended(Result)^ := ps_pow(Pextended(Params^[0])^, Pextended(Params^[1])^);
end;
procedure Lape_RiemannGauss(const Params: PParamArray; const Result: Pointer);
begin
Pextended(Result)^ := ps_RiemannGauss(Pextended(Params^[0])^, Pextended(Params^[1])^, Pextended(Params^[2])^, Pinteger(Params^[3])^);
end;
procedure Lape_DiscreteGauss(const Params: PParamArray; const Result: Pointer);
begin
PExtendedArray(Result)^ := ps_DiscreteGauss(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pextended(Params^[2])^);
end;
procedure Lape_GaussMatrix(const Params: PParamArray; const Result: Pointer);
begin
P2DExtendedArray(Result)^ := ps_GaussMatrix(Pinteger(Params^[0])^, Pextended(Params^[1])^);
end;
procedure Lape_exp(const Params: PParamArray; const Result: Pointer);
begin
Pextended(Result)^ := ps_exp(Pextended(Params^[0])^);
end;
procedure Lape_Max(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_Max(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_Min(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_Min(PInteger(Params^[0])^, PInteger(Params^[1])^);
end;
procedure Lape_MinE(const Params: PParamArray; const Result: Pointer);
begin
Pextended(Result)^ := ps_MinE(Pextended(Params^[0])^, Pextended(Params^[1])^);
end;
procedure Lape_MaxE(const Params: PParamArray; const Result: Pointer);
begin
Pextended(Result)^ := ps_MaxE(Pextended(Params^[0])^, Pextended(Params^[1])^);
end;
procedure Lape_Sqr(const Params: PParamArray; const Result: Pointer);
begin
Pextended(Result)^ := ps_Sqr(Pextended(Params^[0])^);
end;
procedure Lape_Point(const Params: PParamArray; const Result: Pointer);
begin
PPoint(Result)^ := ps_Point(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_Distance(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_Distance(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^, Pinteger(Params^[3])^);
end;
procedure Lape_Hypot(const Params: PParamArray; const Result: Pointer);
begin
PExtended(Result)^ := ps_Hypot(PExtended(Params^[0])^, PExtended(Params^[1])^);
end;
procedure Lape_RandomRange(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_RandomRange(PInteger(Params^[0])^, PInteger(Params^[1])^);
end;
procedure Lape_Random(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_Random(Pinteger(Params^[0])^);
end;
procedure Lape_RandomE(const Params: PParamArray; const Result: Pointer);
begin
Pextended(Result)^ := ps_RandomE();
end;
procedure Lape_ArcTan2(const Params: PParamArray; const Result: Pointer);
begin
Pextended(Result)^ := ps_ArcTan2(Pextended(Params^[0])^, Pextended(Params^[1])^);
end;
procedure Lape_IncEx(const Params: PParamArray);
begin
ps_IncEx(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_DecEx(const Params: PParamArray);
begin
ps_DecEx(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_Factorial(const Params: PParamArray; const Result: Pointer);
begin
PInt64(Result)^ := ps_Factorial(Plongword(Params^[0])^);
end;

View File

@ -0,0 +1,39 @@
procedure Lape_MoveMouse(const Params: PParamArray);
begin
ps_MoveMouse(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_ScrollMouse(const Params: PParamArray);
begin
ps_ScrollMouse(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^);
end;
procedure Lape_GetMousePos(const Params: PParamArray);
begin
ps_GetMousePos(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_ConvIntClickType(const Params: PParamArray; const Result: Pointer);
begin
PClickType(Result)^ := ConvIntClickType(PInteger(Params^[0])^);
end;
procedure Lape_HoldMouse(const Params: PParamArray);
begin
ps_HoldMouse(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^);
end;
procedure Lape_ReleaseMouse(const Params: PParamArray);
begin
ps_ReleaseMouse(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^);
end;
procedure Lape_ClickMouse(const Params: PParamArray);
begin
ps_ClickMouse(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^);
end;
procedure Lape_IsMouseButtonDown(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_IsMouseButtonDown(Pinteger(Params^[0])^);
end;

View File

@ -0,0 +1,19 @@
procedure Lape_rs_GetUpText(const Params: PParamArray; const Result: Pointer);
begin
PString(Result)^ := ps_rs_GetUpText();
end;
procedure Lape_rs_GetUpTextAtEx(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_rs_GetUpTextAtEx(Pinteger(Params^[0])^, Pinteger(Params^[1])^, Pboolean(Params^[2])^);
end;
procedure Lape_rs_GetUpTextAt(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_rs_GetUpTextAt(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_BitmapFromText(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_BitmapFromText(PString(Params^[0])^, PString(Params^[1])^);
end;

View File

@ -0,0 +1,19 @@
procedure Lape_Writeln(const Params: PParamArray);
begin
ps_Writeln(Pstring(Params^[0])^);
end;
procedure Lape_SetScriptProp(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_SetScriptProp(PSP_Property(Params^[0])^, PVariantArray(Params^[1])^);
end;
procedure Lape_GetScriptProp(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_GetScriptProp(PSP_Property(Params^[0])^, PVariantArray(Params^[1])^);
end;
procedure Lape_Wait(const Params: PParamArray);
begin
ps_Wait(PDWord(Params^[0])^);
end;

View File

@ -0,0 +1,39 @@
procedure Lape_SetSettingValue(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_SetSettingValue(Pstring(Params^[0])^, Pstring(Params^[1])^);
end;
procedure Lape_KeyIsSetting(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_KeyIsSetting(PString(Params^[0])^);
end;
procedure Lape_KeyIsDirectory(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_KeyIsDirectory(PString(Params^[0])^);
end;
procedure Lape_GetSettingValue(const Params: PParamArray; const Result: Pointer);
begin
PString(Result)^ := ps_GetSettingValue(PString(Params^[0])^);
end;
procedure Lape_GetSettingValueDef(const Params: PParamArray; const Result: Pointer);
begin
PString(Result)^ := ps_GetSettingValueDef(PString(Params^[0])^, PString(Params^[1])^);
end;
procedure Lape_ListSettings(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_ListSettings(PString(Params^[0])^, PStringArray(Params^[1])^);
end;
procedure Lape_DeleteSetting(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_DeleteSetting(PString(Params^[0])^);
end;
procedure Lape_DeleteSubSettings(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_DeleteSubSettings(PString(Params^[0])^);
end;

View File

@ -0,0 +1,84 @@
procedure Lape_Capitalize(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_Capitalize(Pstring(Params^[0])^);
end;
procedure Lape_CompressString(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_CompressString(Pstring(Params^[0])^);
end;
procedure Lape_DecompressString(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_DecompressString(Pstring(Params^[0])^);
end;
procedure Lape_Base64Encode(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_Base64Encode(Pstring(Params^[0])^);
end;
procedure Lape_Base64Decode(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_Base64Decode(Pstring(Params^[0])^);
end;
procedure Lape_ExtractFromStr(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_ExtractFromStr(Pstring(Params^[0])^, PStrExtr(Params^[1])^);
end;
procedure Lape_BoolToStr(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_BoolToStr(Pboolean(Params^[0])^);
end;
procedure Lape_Replace(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_Replace(Pstring(Params^[0])^, Pstring(Params^[1])^, Pstring(Params^[2])^, PReplaceFlags(Params^[3])^);
end;
procedure Lape_IntToStr(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_IntToStr(Pinteger(Params^[0])^);
end;
procedure Lape_FloatToStr(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_FloatToStr(Pextended(Params^[0])^);
end;
procedure Lape_StrToInt(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_StrToInt(PString(Params^[0])^);
end;
procedure Lape_StrToIntDef(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_StrToIntDef(PString(Params^[0])^, PInteger(Params^[1])^);
end;
procedure Lape_StrToFloat(const Params: PParamArray; const Result: Pointer);
begin
PExtended(Result)^ := ps_StrToFloat(PString(Params^[0])^);
end;
procedure Lape_StrToFloatDef(const Params: PParamArray; const Result: Pointer);
begin
PExtended(Result)^ := ps_StrToFloatDef(PString(Params^[0])^, PExtended(Params^[1])^);
end;
procedure Lape_StrToBool(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_StrToBool(PString(Params^[0])^);
end;
procedure Lape_StrToBoolDef(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_StrToBoolDef(PString(Params^[0])^, PBoolean(Params^[1])^);
end;
procedure Lape_Between(const Params: PParamArray; const Result: Pointer);
begin
Pstring(Result)^ := ps_Between(Pstring(Params^[0])^, Pstring(Params^[1])^, Pstring(Params^[2])^);
end;

View File

@ -0,0 +1,424 @@
procedure Lape_Quicksort(const Params: PParamArray);
begin
ps_Quicksort(PIntegerArray(Params^[0])^);
end;
procedure Lape_tSwap(const Params: PParamArray);
begin
ps_tSwap(PPoint(Params^[0])^, PPoint(Params^[1])^);
end;
procedure Lape_tpaSwap(const Params: PParamArray);
begin
ps_tpaSwap(PPointArray(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_SwapE(const Params: PParamArray);
begin
ps_SwapE(PExtended(Params^[0])^, PExtended(Params^[1])^);
end;
procedure Lape_RAaSTPAEx(const Params: PParamArray);
begin
ps_RAaSTPAEx(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^);
end;
procedure Lape_RAaSTPA(const Params: PParamArray);
begin
ps_RAaSTPA(PPointArray(Params^[0])^, PInteger(Params^[1])^);
end;
procedure Lape_NearbyPointInArrayEx(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_NearbyPointInArrayEx(PPoint(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PPointArray(Params^[3])^);
end;
procedure Lape_NearbyPointInArray(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_NearbyPointInArray(PPoint(Params^[0])^, PInteger(Params^[1])^, PPointArray(Params^[2])^);
end;
procedure Lape_QuickTPASort(const Params: PParamArray);
begin
ps_QuickTPASort(PIntegerArray(Params^[0])^, PPointArray(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PBoolean(Params^[4])^);
end;
procedure Lape_QuickATPASort(const Params: PParamArray);
begin
ps_QuickATPASort(PIntegerArray(Params^[0])^, P2DPointArray(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PBoolean(Params^[4])^);
end;
procedure Lape_SortTPAFrom(const Params: PParamArray);
begin
ps_SortTPAFrom(PPointArray(Params^[0])^, PPoint(Params^[1])^);
end;
procedure Lape_SortATPAFrom(const Params: PParamArray);
begin
ps_SortATPAFrom(P2DPointArray(Params^[0])^, PPoint(Params^[1])^);
end;
procedure Lape_SortATPAFromFirstPoint(const Params: PParamArray);
begin
ps_SortATPAFromFirstPoint(P2DPointArray(Params^[0])^, PPoint(Params^[1])^);
end;
procedure Lape_InvertTPA(const Params: PParamArray);
begin
ps_InvertTPA(PPointArray(Params^[0])^);
end;
procedure Lape_InvertATPA(const Params: PParamArray);
begin
ps_InvertATPA(P2DPointArray(Params^[0])^);
end;
procedure Lape_MiddleTPAEx(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_MiddleTPAEx(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^);
end;
procedure Lape_MiddleTPA(const Params: PParamArray; const Result: Pointer);
begin
PPoint(Result)^ := ps_MiddleTPA(PPointArray(Params^[0])^);
end;
procedure Lape_SortATPASize(const Params: PParamArray);
begin
ps_SortATPASize(P2DPointArray(Params^[0])^, PBoolean(Params^[1])^);
end;
procedure Lape_SortATPAFromSize(const Params: PParamArray);
begin
ps_SortATPAFromSize(P2DPointArray(Params^[0])^, PInteger(Params^[1])^, PBoolean(Params^[2])^);
end;
procedure Lape_InIntArrayEx(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_InIntArrayEx(PIntegerArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^);
end;
procedure Lape_InIntArray(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_InIntArray(PIntegerArray(Params^[0])^, PInteger(Params^[1])^);
end;
procedure Lape_ClearSameIntegers(const Params: PParamArray);
begin
ps_ClearSameIntegers(PIntegerArray(Params^[0])^);
end;
procedure Lape_ClearSameIntegersAndTPA(const Params: PParamArray);
begin
ps_ClearSameIntegersAndTPA(PIntegerArray(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_SplitTPAEx(const Params: PParamArray; const Result: Pointer);
begin
P2DPointArray(Result)^ := ps_SplitTPAEx(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^);
end;
procedure Lape_SplitTPA(const Params: PParamArray; const Result: Pointer);
begin
P2DPointArray(Result)^ := ps_SplitTPA(PPointArray(Params^[0])^, PInteger(Params^[1])^);
end;
procedure Lape_FloodFillTPA(const Params: PParamArray; const Result: Pointer);
begin
P2DPointArray(Result)^ := ps_FloodFillTPA(PPointArray(Params^[0])^);
end;
procedure Lape_FilterPointsPie(const Params: PParamArray);
begin
ps_FilterPointsPie(PPointArray(Params^[0])^, PExtended(Params^[1])^, PExtended(Params^[2])^, PExtended(Params^[3])^, PExtended(Params^[4])^, PInteger(Params^[5])^, PInteger(Params^[6])^);
end;
procedure Lape_FilterPointsDist(const Params: PParamArray);
begin
ps_FilterPointsDist(PPointArray(Params^[0])^, PExtended(Params^[1])^, PExtended(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^);
end;
procedure Lape_FilterPointsLine(const Params: PParamArray);
begin
ps_FilterPointsLine(PPointArray(Params^[0])^, PExtended(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PInteger(Params^[4])^);
end;
procedure Lape_FilterTPADist(const Params: PParamArray);
begin
ps_FilterTPADist(PPointArray(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_GetATPABounds(const Params: PParamArray; const Result: Pointer);
begin
PBox(Result)^ := ps_GetATPABounds(P2DPointArray(Params^[0])^);
end;
procedure Lape_GetTPABounds(const Params: PParamArray; const Result: Pointer);
begin
PBox(Result)^ := ps_GetTPABounds(PPointArray(Params^[0])^);
end;
procedure Lape_FindTPAinTPA(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindTPAinTPA(PPointArray(Params^[0])^, PPointArray(Params^[1])^, PPointArray(Params^[2])^);
end;
procedure Lape_GetSamePointsATPA(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_GetSamePointsATPA(P2DPointArray(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_FindTextTPAinTPA(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_FindTextTPAinTPA(Pinteger(Params^[0])^, PPointArray(Params^[1])^, PPointArray(Params^[2])^, PPointArray(Params^[3])^);
end;
procedure Lape_SortCircleWise(const Params: PParamArray);
begin
ps_SortCircleWise(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PBoolean(Params^[4])^, PBoolean(Params^[5])^);
end;
procedure Lape_LinearSort(const Params: PParamArray);
begin
ps_LinearSort(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PInteger(Params^[3])^, PBoolean(Params^[4])^);
end;
procedure Lape_RotatePoint(const Params: PParamArray; const Result: Pointer);
begin
PPoint(Result)^ := ps_RotatePoint(PPoint(Params^[0])^, PExtended(Params^[1])^, PExtended(Params^[2])^, PExtended(Params^[3])^);
end;
procedure Lape_ChangeDistPT(const Params: PParamArray; const Result: Pointer);
begin
PPoint(Result)^ := ps_ChangeDistPT(PPoint(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^, Pextended(Params^[3])^);
end;
procedure Lape_ChangeDistTPA(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_ChangeDistTPA(PPointArray(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^, Pextended(Params^[3])^);
end;
procedure Lape_FindGapsTPA(const Params: PParamArray; const Result: Pointer);
begin
P2DPointArray(Result)^ := ps_FindGapsTPA(PPointArray(Params^[0])^, PInteger(Params^[1])^);
end;
procedure Lape_RemoveDistTPointArray(const Params: PParamArray; const Result: Pointer);
begin
PPointArray(Result)^ := ps_RemoveDistTPointArray(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PPointArray(Params^[3])^, PBoolean(Params^[4])^);
end;
procedure Lape_CombineTPA(const Params: PParamArray; const Result: Pointer);
begin
PPointArray(Result)^ := ps_CombineTPA(PPointArray(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_ReArrangeandShortenArrayEx(const Params: PParamArray; const Result: Pointer);
begin
PPointArray(Result)^ := ps_ReArrangeandShortenArrayEx(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^);
end;
procedure Lape_ReArrangeandShortenArray(const Params: PParamArray; const Result: Pointer);
begin
PPointArray(Result)^ := ps_ReArrangeandShortenArray(PPointArray(Params^[0])^, PInteger(Params^[1])^);
end;
procedure Lape_TPAtoATPAEx(const Params: PParamArray; const Result: Pointer);
begin
P2DPointArray(Result)^ := ps_TPAtoATPAEx(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^);
end;
procedure Lape_TPAtoATPA(const Params: PParamArray; const Result: Pointer);
begin
P2DPointArray(Result)^ := ps_TPAtoATPA(PPointArray(Params^[0])^, PInteger(Params^[1])^);
end;
procedure Lape_CombineIntArray(const Params: PParamArray; const Result: Pointer);
begin
PIntegerArray(Result)^ := ps_CombineIntArray(PIntegerArray(Params^[0])^, PIntegerArray(Params^[1])^);
end;
procedure Lape_MergeATPA(const Params: PParamArray; const Result: Pointer);
begin
PPointArray(Result)^ := ps_MergeATPA(P2DPointArray(Params^[0])^);
end;
procedure Lape_AppendTPA(const Params: PParamArray);
begin
ps_AppendTPA(PPointArray(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_TPAFromBox(const Params: PParamArray; const Result: Pointer);
begin
PPointArray(Result)^ := ps_TPAFromBox(PBox(Params^[0])^);
end;
procedure Lape_RotatePoints(const Params: PParamArray; const Result: Pointer);
begin
PPointArray(Result)^ := ps_RotatePoints(PPointArray(Params^[0])^, PExtended(Params^[1])^, PExtended(Params^[2])^, PExtended(Params^[3])^);
end;
procedure Lape_FindTPAEdges(const Params: PParamArray; const Result: Pointer);
begin
PPointArray(Result)^ := ps_FindTPAEdges(PPointArray(Params^[0])^);
end;
procedure Lape_ClearTPAFromTPA(const Params: PParamArray; const Result: Pointer);
begin
PPointArray(Result)^ := ps_ClearTPAFromTPA(PPointArray(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_ReturnPointsNotInTPA(const Params: PParamArray; const Result: Pointer);
begin
PPointArray(Result)^ := ps_ReturnPointsNotInTPA(PPointArray(Params^[0])^, PBox(Params^[1])^);
end;
procedure Lape_PointInTPA(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_PointInTPA(PPoint(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_ClearDoubleTPA(const Params: PParamArray);
begin
ps_ClearDoubleTPA(PPointArray(Params^[0])^);
end;
procedure Lape_TPACountSort(const Params: PParamArray);
begin
ps_TPACountSort(PPointArray(Params^[0])^, PPoint(Params^[1])^, PBoolean(Params^[2])^);
end;
procedure Lape_TPACountSortBase(const Params: PParamArray);
begin
ps_TPACountSortBase(PPointArray(Params^[0])^, PPoint(Params^[1])^, PPoint(Params^[2])^, PBoolean(Params^[3])^);
end;
procedure Lape_InvertTIA(const Params: PParamArray);
begin
ps_InvertTIA(PIntegerArray(Params^[0])^);
end;
procedure Lape_SumIntegerArray(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_SumIntegerArray(PIntegerArray(Params^[0])^);
end;
procedure Lape_AverageTIA(const Params: PParamArray; const Result: Pointer);
begin
PInteger(Result)^ := ps_AverageTIA(PIntegerArray(Params^[0])^);
end;
procedure Lape_AverageExtended(const Params: PParamArray; const Result: Pointer);
begin
PExtended(Result)^ := ps_AverageExtended(PExtendedArray(Params^[0])^);
end;
procedure Lape_SplitTPAExWrap(const Params: PParamArray);
begin
ps_SplitTPAExWrap(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, P2DPointArray(Params^[3])^);
end;
procedure Lape_SplitTPAWrap(const Params: PParamArray);
begin
ps_SplitTPAWrap(PPointArray(Params^[0])^, PInteger(Params^[1])^, P2DPointArray(Params^[2])^);
end;
procedure Lape_FindGapsTPAWrap(const Params: PParamArray);
begin
ps_FindGapsTPAWrap(PPointArray(Params^[0])^, PInteger(Params^[1])^, P2DPointArray(Params^[2])^);
end;
procedure Lape_RemoveDistTPointArrayWrap(const Params: PParamArray);
begin
ps_RemoveDistTPointArrayWrap(PInteger(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PPointArray(Params^[3])^, PBoolean(Params^[4])^, PPointArray(Params^[5])^);
end;
procedure Lape_CombineTPAWrap(const Params: PParamArray);
begin
ps_CombineTPAWrap(PPointArray(Params^[0])^, PPointArray(Params^[1])^, PPointArray(Params^[2])^);
end;
procedure Lape_ReArrangeandShortenArrayExWrap(const Params: PParamArray);
begin
ps_ReArrangeandShortenArrayExWrap(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, PPointArray(Params^[3])^);
end;
procedure Lape_ReArrangeandShortenArrayWrap(const Params: PParamArray);
begin
ps_ReArrangeandShortenArrayWrap(PPointArray(Params^[0])^, PInteger(Params^[1])^, PPointArray(Params^[2])^);
end;
procedure Lape_TPAtoATPAExWrap(const Params: PParamArray);
begin
ps_TPAtoATPAExWrap(PPointArray(Params^[0])^, PInteger(Params^[1])^, PInteger(Params^[2])^, P2DPointArray(Params^[3])^);
end;
procedure Lape_TPAtoATPAWrap(const Params: PParamArray);
begin
ps_TPAtoATPAWrap(PPointArray(Params^[0])^, PInteger(Params^[1])^, P2DPointArray(Params^[2])^);
end;
procedure Lape_CombineIntArrayWrap(const Params: PParamArray);
begin
ps_CombineIntArrayWrap(PIntegerArray(Params^[0])^, PIntegerArray(Params^[1])^, PIntegerArray(Params^[2])^);
end;
procedure Lape_MergeATPAWrap(const Params: PParamArray);
begin
ps_MergeATPAWrap(P2DPointArray(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_TPAFromBoxWrap(const Params: PParamArray);
begin
ps_TPAFromBoxWrap(PBox(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_RotatePointsWrap(const Params: PParamArray);
begin
ps_RotatePointsWrap(PPointArray(Params^[0])^, PExtended(Params^[1])^, PExtended(Params^[2])^, PExtended(Params^[3])^, PPointArray(Params^[4])^);
end;
procedure Lape_FindTPAEdgesWrap(const Params: PParamArray);
begin
ps_FindTPAEdgesWrap(PPointArray(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_ClearTPAFromTPAWrap(const Params: PParamArray);
begin
ps_ClearTPAFromTPAWrap(PPointArray(Params^[0])^, PPointArray(Params^[1])^, PPointArray(Params^[2])^);
end;
procedure Lape_ReturnPointsNotInTPAWrap(const Params: PParamArray);
begin
ps_ReturnPointsNotInTPAWrap(PPointArray(Params^[0])^, PBox(Params^[1])^, PPointArray(Params^[2])^);
end;
procedure Lape_SameTPA(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_SameTPA(PPointArray(Params^[0])^, PPointArray(Params^[1])^);
end;
procedure Lape_TPAInATPA(const Params: PParamArray; const Result: Pointer);
begin
PBoolean(Result)^ := ps_TPAInATPA(PPointArray(Params^[0])^, P2DPointArray(Params^[1])^, PLongInt(Params^[2])^);
end;
procedure Lape_OffsetTPA(const Params: PParamArray);
begin
ps_OffsetTPA(PPointArray(Params^[0])^, PPoint(Params^[1])^);
end;
procedure Lape_OffsetATPA(const Params: PParamArray);
begin
ps_OffsetATPA(P2DPointArray(Params^[0])^, PPoint(Params^[1])^);
end;
procedure Lape_CopyTPA(const Params: PParamArray; const Result: Pointer);
begin
PPointArray(Result)^ := ps_CopyTPA(PPointArray(Params^[0])^);
end;
procedure Lape_CopyATPA(const Params: PParamArray; const Result: Pointer);
begin
P2DPointArray(Result)^ := ps_CopyATPA(P2DPointArray(Params^[0])^);
end;

View File

@ -0,0 +1,84 @@
procedure Lape_SetDesktopAsClient(const Params: PParamArray);
begin
ps_SetDesktopAsClient();
end;
procedure Lape_SetTargetArray(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_SetTargetArray(PInteger(Params^[0])^, Pinteger(Params^[1])^, Pinteger(Params^[2])^);
end;
procedure Lape_SetTargetBitmap(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_SetTargetBitmap(PInteger(Params^[0])^);
end;
procedure Lape_SetEIOSTarget(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_SetEIOSTarget(Pstring(Params^[0])^, PVariant(Params^[1])^);
end;
procedure Lape_SetImageTarget(const Params: PParamArray);
begin
ps_SetImageTarget(Pinteger(Params^[0])^);
end;
procedure Lape_SetKeyMouseTarget(const Params: PParamArray);
begin
ps_SetKeyMouseTarget(Pinteger(Params^[0])^);
end;
procedure Lape_GetImageTarget(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_GetImageTarget();
end;
procedure Lape_GetKeyMouseTarget(const Params: PParamArray; const Result: Pointer);
begin
Pinteger(Result)^ := ps_GetKeyMouseTarget();
end;
procedure Lape_ExportImageTarget(const Params: PParamArray; const Result: Pointer);
begin
PTarget_Exported(Result)^ := ps_ExportImageTarget();
end;
procedure Lape_ExportKeyMouseTarget(const Params: PParamArray; const Result: Pointer);
begin
PTarget_Exported(Result)^ := ps_ExportKeyMouseTarget();
end;
procedure Lape_FreeTarget(const Params: PParamArray);
begin
ps_FreeTarget(Pinteger(Params^[0])^);
end;
procedure Lape_GetClientDimensions(const Params: PParamArray);
begin
ps_GetClientDimensions(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_GetClientPosition(const Params: PParamArray);
begin
ps_GetClientPosition(Pinteger(Params^[0])^, Pinteger(Params^[1])^);
end;
procedure Lape_Freeze(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_Freeze();
end;
procedure Lape_Unfreeze(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_Unfreeze();
end;
procedure Lape_ActivateClient(const Params: PParamArray);
begin
ps_ActivateClient();
end;
procedure Lape_IsTargetValid(const Params: PParamArray; const Result: Pointer);
begin
Pboolean(Result)^ := ps_IsTargetValid();
end;

View File

@ -0,0 +1,96 @@
{
This file is part of the Mufasa Macro Library (MML)
Copyright (c) 2009 by Raymond van Venetië and Merlijn Wajer
MML 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 3 of the License, or
(at your option) any later version.
MML 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 MML. If not, see <http://www.gnu.org/licenses/>.
See the file COPYING, included in this distribution,
for details about the copyright.
lpcompile.inc for the Mufasa Macro Library
}
addGlobalVar(AppPath, 'AppPath');
addGlobalVar(ScriptPath, 'ScriptPath');
addGlobalVar(IncludePath, 'IncludePath');
addGlobalVar(PluginPath, 'PluginPath');
addGlobalVar(FontPath, 'FontPath');
addGlobalVar(maxLongint, 'MaxLongInt');
addGlobalVar(maxLongint, 'MaxInt');
addGlobalVar(ps_mouse_right, 'mouse_Right');//0
addGlobalVar(ps_mouse_left, 'mouse_Left');//1
addGlobalVar(ps_mouse_middle, 'mouse_Middle');//2
addGlobalType('UInt32', 'TClickType');
addGlobalType('UInt8', 'Byte');
addGlobalType('Int8', 'ShortInt');
addGlobalType('UInt16', 'Word');
addGlobalType('Int16', 'SmallInt');
addGlobalType('UInt32', 'LongWord');
addGlobalType('UInt32', 'DWord');
addGlobalType('UInt32', 'Cardinal');
addGlobalType('Int32', 'LongInt');
addGlobalType('UInt64', 'QWord');
addGlobalType('LongInt', 'Integer');
addGlobalType('Integer', 'TColor');
addGlobalType('Double', 'TDateTime');
addGlobalType('(rfReplaceAll, rfIgnoreCase)', 'TReplaceFlag');
addGlobalType('set of TReplaceFlag', 'TReplaceFlags');
addGlobalType('(Numbers, Letters, Others)', 'StrExtr');
addGlobalType('(MirrorWidth, MirrorHeight, MirrorLine)', 'TBmpMirrorStyle');
addGlobalType('(mouse_Down, mouse_Up)', 'TMousePress');
addGlobalType('(SP_WriteTimeStamp, SP_OnTerminate)', 'TSP_Property');
addGlobalType('array of string', 'TStringArray');
addGlobalType('array of Integer', 'TIntegerArray');
addGlobalType('array of TIntegerArray', 'T2DIntegerArray');
addGlobalType('array of TIntegerArray', 'T2DIntArray');
addGlobalType('array of T2DIntegerArray', 'T3DIntegerArray');
addGlobalType('array of byte', 'TByteArray');
addGlobalType('array of extended', 'TExtendedArray');
addGlobalType('array of TExtendedArray', 'T2DExtendedArray');
addGlobalType('array of T2DExtendedArray', 'T3DExtendedArray');
addGlobalType('array of boolean', 'TBoolArray');
addGlobalType('array of variant', 'TVariantArray');
addGlobalType('record X1, Y1, X2, Y2: integer; end', 'TBox');
addGlobalType('array of TBox', 'TBoxArray');
addGlobalType('record X, Y: integer; end', 'TPoint');
addGlobalType('array of TPoint', 'TPointArray');
addGlobalType('array of TPointArray', 'T2DPointArray');
addGlobalType('T2DPointArray', 'TPointArrayArray');
addGlobalType('record White, Black: TPointarray; WhiteHi, BlackHi: integer; W, H: integer; end', 'TMask');
addGlobalType('record R, T: extended; end', 'PPoint');
addGlobalType('record int1,int2,int3,int4,int5,int6,int7,int8,int9,int10,int11,int12,int13,int14,int15,int16: integer; end', 'TTarget_Exported');
addGlobalType('record x, y, Color, Tolerance, AreaSize, AreaShape: integer; end', 'TSDTMPointDef');
addGlobalType('array of TSDTMPointDef', 'TSDTMPointDefArray');
addGlobalType('record MainPoint: TSDTMPointDef; SubPoints: TSDTMPointDefarray; end', 'TSDTM');
addGlobalType('record x, y, c, t, asz: integer; bp: boolean; end', 'TMDTMPoint');
addGlobalType('array of TMDTMPoint', 'TMDTMPointArray');
addGlobalType('record Title: string; Handle: integer; Pid: integer; Width, Height: integer; end', 'TSysProc');
addGlobalType('array of TSysProc', 'TSysProcArr');

View File

@ -0,0 +1,39 @@
{
This file is part of the Mufasa Macro Library (MML)
Copyright (c) 2009 by Raymond van Venetië and Merlijn Wajer
MML 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 3 of the License, or
(at your option) any later version.
MML 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 MML. If not, see <http://www.gnu.org/licenses/>.
See the file COPYING, included in this distribution,
for details about the copyright.
lpdefines.inc for the Mufasa Macro Library
}
BaseDefines.Add('LAPE');
{$IFDEF CPU386 }
BaseDefines.Add('CPU386');
{$ENDIF }
BaseDefines.Add('MUFASA');
BaseDefines.Add('COGAT');
BaseDefines.Add('SIMBA');
BaseDefines.Add('DGROCKS');
{$IFDEF MSWINDOWS }
BaseDefines.Add('MSWINDOWS');
BaseDefines.Add('WIN32');
BaseDefines.Add('WINDOWS');
{$ENDIF }
{$IFDEF LINUX }
BaseDefines.Add('LINUX');
{$ENDIF }

View File

@ -0,0 +1,25 @@
{
This file is part of the Mufasa Macro Library (MML)
Copyright (c) 2009 by Raymond van Venetië and Merlijn Wajer
MML 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 3 of the License, or
(at your option) any later version.
MML 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 MML. If not, see <http://www.gnu.org/licenses/>.
See the file COPYING, included in this distribution,
for details about the copyright.
lpexportedmethods.inc for the Mufasa Macro Library
}
{$I lpexportedmethodsinc.inc}
//These will be added from Generator...

View File

@ -0,0 +1,323 @@
AddGlobalFunc('function CreateBitmapString(bmp: integer): string', @Lape_CreateBitmapString);
//AddGlobalFunc('function GetMufasaBitmap(bmp: integer): TMufasaBitmap', @Lape_GetMufasaBitmap);
AddGlobalFunc('function CreateBitmap(w,h: integer): integer', @Lape_CreateBitmap);
AddGlobalFunc('procedure FreeBitmap(Number: integer);', @Lape_FreeBitmap);
AddGlobalFunc('procedure SaveBitmap(Bmp: integer; path: string);', @Lape_SaveBitmap);
AddGlobalFunc('function BitmapFromString(Width,height: integer; Data: string): integer', @Lape_BitmapFromString);
AddGlobalFunc('function LoadBitmap(Path: String): integer', @Lape_LoadBitmap);
AddGlobalFunc('procedure SetBitmapSize(Bmp,NewW,NewH: integer);', @Lape_SetBitmapSize);
AddGlobalFunc('procedure StretchBitmapResize(Bmp,NewW,NewH: integer);', @Lape_StretchBitmapResize);
AddGlobalFunc('procedure GetBitmapSize(Bmp: integer; var BmpW,BmpH: integer);', @Lape_GetBitmapSize);
AddGlobalFunc('procedure SetBitmapName(Bmp: integer; name: string);', @Lape_SetBitmapName);
AddGlobalFunc('function CreateMirroredBitmap(Bmp: integer): integer', @Lape_CreateMirroredBitmap);
AddGlobalFunc('function CreateMirroredBitmapEx(Bmp: integer; MirrorStyle: TBmpMirrorStyle): integer', @Lape_CreateMirroredBitmapEx);
AddGlobalFunc('function FastGetPixel(bmp,x,y: integer): LongWord', @Lape_FastGetPixel);
AddGlobalFunc('function FastGetPixels(bmp: integer; TPA: TPointArray): TIntegerArray', @Lape_FastGetPixels);
AddGlobalFunc('function GetBitmapAreaColors(bmp,xs, ys, xe, ye: Integer): T2DIntArray', @Lape_GetBitmapAreaColors);
AddGlobalFunc('procedure FastSetPixel(Bmp,x,y: integer; Color: TColor);', @Lape_FastSetPixel);
AddGlobalFunc('procedure FastSetPixels(Bmp: integer; TPA: TPointArray; Colors: TIntegerArray);', @Lape_FastSetPixels);
AddGlobalFunc('procedure DrawTPABitmap(bitmap: integer; TPA: TPointArray; Color: integer);', @Lape_DrawTPABitmap);
AddGlobalFunc('procedure DrawATPABitmap(bitmap: integer; ATPA: T2DPointArray);', @Lape_DrawATPABitmap);
AddGlobalFunc('procedure DrawATPABitmapEx(bitmap: integer; ATPA: T2DPointArray; Colors: TIntegerArray);', @Lape_DrawATPABitmapEx);
AddGlobalFunc('procedure FastDrawClear(bmp: integer; Color: TColor);', @Lape_FastDrawClear);
//AddGlobalFunc('procedure DrawBitmap(Bmp: Integer; Dest: TCanvas; x, y: Integer);', @Lape_DrawBitmap);
AddGlobalFunc('procedure FastDrawTransparent(x, y: Integer; SourceBitmap, TargetBitmap: Integer);', @Lape_FastDrawTransparent);
AddGlobalFunc('procedure SetTransparentColor(Bmp: integer; Color: TColor);', @Lape_SetTransparentColor);
AddGlobalFunc('function GetTransparentColor(Bmp: integer): TColor', @Lape_GetTransparentColor);
AddGlobalFunc('procedure FastReplaceColor(bmp: Integer; OldColor, NewColor: TColor);', @Lape_FastReplaceColor);
AddGlobalFunc('procedure CopyClientToBitmap(bmp, xs, ys, xe, ye: Integer);', @Lape_CopyClientToBitmap);
AddGlobalFunc('function BitmapFromClient(const xs, ys, xe, ye: Integer): Integer', @Lape_BitmapFromClient);
AddGlobalFunc('function FindBitmap(Bitmap: integer; var x, y: Integer): Boolean', @Lape_FindBitmap);
AddGlobalFunc('function FindBitmapIn(bitmap: integer; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean', @Lape_FindBitmapIn);
AddGlobalFunc('function FindBitmapToleranceIn(bitmap: integer; var x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer): Boolean', @Lape_FindBitmapToleranceIn);
AddGlobalFunc('function FindBitmapSpiral(bitmap: Integer; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean', @Lape_FindBitmapSpiral);
AddGlobalFunc('function FindBitmapsSpiralTolerance(bitmap: integer; x, y: Integer; var Points: TPointArray; xs, ys, xe, ye,tolerance: Integer): Boolean', @Lape_FindBitmapsSpiralTolerance);
AddGlobalFunc('function FindBitmapSpiralTolerance(bitmap: integer; var x, y: Integer; xs, ys, xe, ye,tolerance: integer): Boolean', @Lape_FindBitmapSpiralTolerance);
AddGlobalFunc('function RotateBitmap(bitmap: Integer; angle: Extended): Integer', @Lape_RotateBitmap);
AddGlobalFunc('function Desaturate(Bitmap: integer): integer', @Lape_Desaturate);
AddGlobalFunc('procedure InvertBitmap(Bitmap: integer);', @Lape_InvertBitmap);
AddGlobalFunc('function CopyBitmap(Bitmap: integer): integer', @Lape_CopyBitmap);
AddGlobalFunc('function GreyScaleBitmap(Bitmap: integer): integer', @Lape_GreyScaleBitmap);
AddGlobalFunc('function BrightnessBitmap(Bitmap,br: integer): integer', @Lape_BrightnessBitmap);
AddGlobalFunc('function ContrastBitmap(bitmap: integer; co: extended): integer', @Lape_ContrastBitmap);
AddGlobalFunc('function PosterizeBitmap(Bitmap: integer; po: integer): integer', @Lape_PosterizeBitmap);
AddGlobalFunc('function CreateMaskFromBitmap(Bitmap: integer): TMask', @Lape_CreateMaskFromBitmap);
AddGlobalFunc('function FindMaskTolerance(const mask: TMask; var x, y: Integer; xs,ys, xe, ye: Integer; Tolerance, ContourTolerance: Integer): Boolean', @Lape_FindMaskTolerance);
AddGlobalFunc('function FindBitmapMaskTolerance(mask: Integer; var x, y: Integer; xs, ys, xe, ye: Integer; Tolerance, ContourTolerance: Integer): Boolean', @Lape_FindBitmapMaskTolerance);
AddGlobalFunc('function FindDeformedBitmapToleranceIn(bitmap: integer; var x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer; Range: Integer; AllowPartialAccuracy: Boolean; var accuracy: Extended): Boolean', @Lape_FindDeformedBitmapToleranceIn);
AddGlobalFunc('procedure RectangleBitmap(bitmap: integer; const box: TBox; Color: TColor);', @Lape_RectangleBitmap);
AddGlobalFunc('procedure FloodFillBitmap(bitmap: integer; const StartPoint: TPoint; const SearchCol,ReplaceCol: TColor);', @Lape_FloodFillBitmap);
AddGlobalFunc('function ConvoluteBitmap(bitmap: integer; matrix: T2DExtendedArray): integer', @Lape_ConvoluteBitmap);
AddGlobalFunc('function CalculatePixelShift(Bmp1,Bmp2: Integer; CompareBox: TBox): integer', @Lape_CalculatePixelShift);
AddGlobalFunc('function CalculatePixelTolerance(Bmp1,Bmp2: Integer; CompareBox: TBox; CTS: integer): extended', @Lape_CalculatePixelTolerance);
AddGlobalFunc('function GetColor(x,y: integer): TColor', @Lape_GetColor);
AddGlobalFunc('procedure GetColorsWrap(Coords: TPointArray; var Colors: TIntegerArray);', @Lape_GetColorsWrap);
AddGlobalFunc('function GetColors(const Coords: TPointArray): TIntegerArray', @Lape_GetColors);
AddGlobalFunc('function findcolor(var x, y: integer; color, x1, y1, x2, y2: integer): boolean', @Lape_findcolor);
AddGlobalFunc('function findcolortoleranceOptimised(var x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean', @Lape_findcolortoleranceOptimised);
AddGlobalFunc('function findcolortolerance(var x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean', @Lape_findcolortolerance);
AddGlobalFunc('function FindColors(var TPA: TPointArray; Color, x1, y1, x2, y2: Integer): Boolean', @Lape_FindColors);
AddGlobalFunc('procedure SetColorToleranceSpeed(cts: Integer);', @Lape_SetColorToleranceSpeed);
AddGlobalFunc('function GetToleranceSpeed: Integer', @Lape_GetToleranceSpeed);
AddGlobalFunc('procedure SetToleranceSpeed2Modifiers(nHue, nSat: Extended);', @Lape_SetToleranceSpeed2Modifiers);
AddGlobalFunc('procedure GetToleranceSpeed2Modifiers(var hMod, sMod: Extended);', @Lape_GetToleranceSpeed2Modifiers);
AddGlobalFunc('function SimilarColors(Col1,Col2,Tol: integer): boolean', @Lape_SimilarColors);
AddGlobalFunc('function CountColor(Color, xs, ys, xe, ye: Integer): Integer', @Lape_CountColor);
AddGlobalFunc('function CountColorTolerance(Color, xs, ys, xe, ye, Tolerance: Integer): Integer', @Lape_CountColorTolerance);
AddGlobalFunc('function FindColorsToleranceOptimised(var Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean', @Lape_FindColorsToleranceOptimised);
AddGlobalFunc('function FindColorsTolerance(var Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean', @Lape_FindColorsTolerance);
AddGlobalFunc('function FindColorSpiral(var x, y: Integer; color, xs, ys, xe, ye: Integer): Boolean', @Lape_FindColorSpiral);
AddGlobalFunc('function FindColorSpiralTolerance(var x, y: Integer; color, xs, ys, xe, ye,Tol: Integer): Boolean', @Lape_FindColorSpiralTolerance);
AddGlobalFunc('function FindColorsSpiralTolerance(x, y: Integer; var Points: TPointArray; color, xs, ys, xe, ye: Integer; Tolerance: Integer): boolean', @Lape_FindColorsSpiralTolerance);
AddGlobalFunc('function FindColoredArea(var x, y: Integer; color, xs, ys, xe, ye: Integer; MinArea: Integer): Boolean', @Lape_FindColoredArea);
AddGlobalFunc('function FindColoredAreaTolerance(var x, y: Integer; Color, xs, ys, xe, ye, MinArea, tol: Integer): Boolean', @Lape_FindColoredAreaTolerance);
AddGlobalFunc('procedure ColorToRGB(Color: integer; var r, g, b: Integer);', @Lape_ColorToRGB);
AddGlobalFunc('function haval(Data: string): string', @Lape_haval);
AddGlobalFunc('function FindDTM(DTM: Integer; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean', @Lape_FindDTM);
AddGlobalFunc('function FindDTMs(DTM: Integer; var p: TPointArray; xs, ys, xe, ye: Integer): Boolean', @Lape_FindDTMs);
AddGlobalFunc('function FindDTMRotatedAlternating(DTM: Integer; var x, y: Integer; xs, ys, xe, ye: Integer; sAngle, eAngle, aStep: Extended; var aFound: Extended): Boolean', @Lape_FindDTMRotatedAlternating);
AddGlobalFunc('function FindDTMRotatedSE(DTM: Integer; var x, y: Integer; xs, ys, xe, ye: Integer; sAngle, eAngle, aStep: Extended; var aFound: Extended): Boolean', @Lape_FindDTMRotatedSE);
AddGlobalFunc('function FindDTMsRotatedAlternating(DTM: Integer; var Points: TPointArray; xs, ys, xe, ye: Integer; sAngle, eAngle, aStep: Extended; var aFound: T2DExtendedArray): Boolean', @Lape_FindDTMsRotatedAlternating);
AddGlobalFunc('function FindDTMsRotatedSE(DTM: Integer; var Points: TPointArray; xs, ys, xe, ye: Integer; sAngle, eAngle, aStep: Extended; var aFound: T2DExtendedArray): Boolean', @Lape_FindDTMsRotatedSE);
AddGlobalFunc('procedure SetDTMName(DTM: integer; const name: string);', @Lape_SetDTMName);
AddGlobalFunc('function DTMFromString(const DTMString: String): Integer', @Lape_DTMFromString);
AddGlobalFunc('procedure FreeDTM(DTM: Integer);', @Lape_FreeDTM);
//AddGlobalFunc('function GetDTM(index: Integer): TMDTM', @Lape_GetDTM);
AddGlobalFunc('function AddTSDTM(const d: TSDTM): Integer', @Lape_AddTSDTM);
//AddGlobalFunc('function AddDTM(const d: TMDTM): Integer', @Lape_AddDTM);
//AddGlobalFunc('procedure PrintDTM(const aDTM: TMDTM);', @Lape_PrintDTM);
//AddGlobalFunc('function MDTMToSDTM(Const DTM: TMDTM): TSDTM', @Lape_MDTMToSDTM);
//AddGlobalFunc('function SDTMToMDTM(Const DTM: TSDTM): TMDTM', @Lape_SDTMToMDTM);
AddGlobalFunc('function CreateDTMPoint(x,y,c,t,asz: integer; bp: boolean): TMDTMPoint', @Lape_CreateDTMPoint);
(* File isn't included!
AddGlobalFunc('function ext_UnTar(const Input: string; var Content: TStringArray): boolean', @Lape_ext_UnTar);
AddGlobalFunc('function ext_UnTarEx(const Input: string; const outputdir: string; overwrite: boolean): boolean', @Lape_ext_UnTarEx);
AddGlobalFunc('function ext_DecompressBZip2(const input: string; var output: string; const BlockSize: Cardinal): boolean', @Lape_ext_DecompressBZip2);
AddGlobalFunc('function ext_GetPage(const url: string): string', @Lape_ext_GetPage);
//AddGlobalFunc('function ext_MessageDlg(const aCaption, aMsg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer', @Lape_ext_MessageDlg);
//AddGlobalFunc('function ext_SDTMToMDTM(Const DTM: TSDTM): TMDTM', @Lape_ext_SDTMToMDTM);
AddGlobalFunc('function ext_InputQuery(const ACaption, APrompt: String; var Value: String): Boolean', @Lape_ext_InputQuery);
AddGlobalFunc('function ext_ScriptText: string', @Lape_ext_ScriptText);
AddGlobalFunc('function ext_GetSelectedText: string', @Lape_ext_GetSelectedText);
AddGlobalFunc('procedure ext_OpenScript(vName, Data: string; Run: boolean);', @Lape_ext_OpenScript);
AddGlobalFunc('procedure ext_OpenScriptEx(FileName: string; Run: boolean);', @Lape_ext_OpenScriptEx);
AddGlobalFunc('function ext_GetPageEx(const URL, PostData, MimeType: string): string', @Lape_ext_GetPageEx);
AddGlobalFunc('function ext_GetJSONValue(const Data, Value: string): string', @Lape_ext_GetJSONValue);
*)
AddGlobalFunc('function CreateFile(const Path: string): Integer', @Lape_CreateFile);
AddGlobalFunc('function OpenFile(const Path: string; Shared: Boolean): Integer', @Lape_OpenFile);
AddGlobalFunc('function RewriteFile(const Path: string; Shared: Boolean): Integer', @Lape_RewriteFile);
AddGlobalFunc('function AppendFile(const Path: string): Integer', @Lape_AppendFile);
AddGlobalFunc('procedure CloseFile(FileNum: Integer);', @Lape_CloseFile);
AddGlobalFunc('function EndOfFile(FileNum: Integer): Boolean', @Lape_EndOfFile);
AddGlobalFunc('function FileSize(FileNum: Integer): LongInt', @Lape_FileSize);
AddGlobalFunc('function ReadFileString(FileNum: Integer; var s: string; x: Integer): Boolean', @Lape_ReadFileString);
AddGlobalFunc('function WriteFileString(FileNum: Integer; s: string): Boolean', @Lape_WriteFileString);
AddGlobalFunc('function SetFileCharPointer(FileNum, cChars, Origin: Integer): Integer', @Lape_SetFileCharPointer);
AddGlobalFunc('function FilePointerPos(FileNum: Integer): Integer', @Lape_FilePointerPos);
AddGlobalFunc('function FileExists(const FileName: string): Boolean', @Lape_FileExists);
AddGlobalFunc('function DirectoryExists(const DirectoryName: string): Boolean', @Lape_DirectoryExists);
AddGlobalFunc('function CreateDirectory(const DirectoryName: string): boolean', @Lape_CreateDirectory);
AddGlobalFunc('function ForceDirectores(const dir: string): boolean', @Lape_ForceDirectores);
AddGlobalFunc('function GetFiles(const Path, Ext: string): TStringArray', @Lape_GetFiles);
AddGlobalFunc('function GetDirectories(const path: string): TStringArray', @Lape_GetDirectories);
AddGlobalFunc('procedure WriteINI(const Section, KeyName, NewString, FileName: string);', @Lape_WriteINI);
AddGlobalFunc('procedure OpenWebPage(const url: string);', @Lape_OpenWebPage);
AddGlobalFunc('function GetPage(const S: String): String', @Lape_GetPage);
AddGlobalFunc('function InitializeHTTPClient(HandleCookies: Boolean): Integer', @Lape_InitializeHTTPClient);
AddGlobalFunc('procedure FreeHTTPClient(Client: Integer);', @Lape_FreeHTTPClient);
AddGlobalFunc('function GetHTTPPage(Client: Integer; const URL: string): string', @Lape_GetHTTPPage);
AddGlobalFunc('procedure SetHTTPUserAgent(Client: Integer; const Agent: string);', @Lape_SetHTTPUserAgent);
AddGlobalFunc('function PostHTTPPage(Client: Integer; const Url,PostData: string): string', @Lape_PostHTTPPage);
AddGlobalFunc('function PostHTTPPageEx(Client: Integer; const Url: string): string', @Lape_PostHTTPPageEx);
AddGlobalFunc('procedure ClearPostData(Client: Integer);', @Lape_ClearPostData);
AddGlobalFunc('procedure AddPostVariable(Client: Integer; const VarName, VarValue: string);', @Lape_AddPostVariable);
AddGlobalFunc('function GetRawHeaders(Client: Integer): string', @Lape_GetRawHeaders);
AddGlobalFunc('procedure SetProxy(Client: Integer; pHost, pPort: String);', @Lape_SetProxy);
AddGlobalFunc('function RecvSocketStr(Client: integer): string', @Lape_RecvSocketStr);
AddGlobalFunc('function RecvSocket(Client: integer): string', @Lape_RecvSocket);
AddGlobalFunc('function RecvSocketEx(Client, Length: integer): string', @Lape_RecvSocketEx);
AddGlobalFunc('procedure SendSocket(Client: integer; Data: string);', @Lape_SendSocket);
AddGlobalFunc('procedure ConnectSocket(Client: integer; IP, Port: string);', @Lape_ConnectSocket);
AddGlobalFunc('procedure CloseSocket(Client: integer);', @Lape_CloseSocket);
AddGlobalFunc('procedure SetSocketTimeout(Client, Time: integer);', @Lape_SetSocketTimeout);
AddGlobalFunc('procedure BindSocket(Client: integer; IP, Port: string);', @Lape_BindSocket);
AddGlobalFunc('procedure ListenSocket(Client: integer);', @Lape_ListenSocket);
AddGlobalFunc('function AcceptSocket(Client: integer): integer', @Lape_AcceptSocket);
AddGlobalFunc('procedure SocketInfo(Client: integer; out IP, Port: string);', @Lape_SocketInfo);
AddGlobalFunc('function CreateSocket: integer', @Lape_CreateSocket);
AddGlobalFunc('procedure FreeSocket(Client: integer);', @Lape_FreeSocket);
AddGlobalFunc('procedure KeyDown(key: Word);', @Lape_KeyDown);
AddGlobalFunc('procedure KeyUp(key: Word);', @Lape_KeyUp);
AddGlobalFunc('procedure SendKeys(const s: string);', @Lape_SendKeys);
AddGlobalFunc('procedure PressKey(key: Word);', @Lape_PressKey);
AddGlobalFunc('function isKeyDown(key: Word): boolean', @Lape_isKeyDown);
AddGlobalFunc('function GetKeyCode(c: char): integer', @Lape_GetKeyCode);
AddGlobalFunc('function round(e: extended): integer', @Lape_round);
AddGlobalFunc('function iAbs(a: integer): integer', @Lape_iAbs);
AddGlobalFunc('function ceil(e: extended): integer', @Lape_ceil);
AddGlobalFunc('function pow(base,exponent: extended): extended', @Lape_pow);
AddGlobalFunc('function RiemannGauss(Xstart,StepSize,Sigma: extended; AmountSteps: integer): extended', @Lape_RiemannGauss);
AddGlobalFunc('function DiscreteGauss(Xstart,Xend: integer; sigma: extended): TExtendedArray', @Lape_DiscreteGauss);
AddGlobalFunc('function GaussMatrix(N: integer; sigma: extended): T2DExtendedArray', @Lape_GaussMatrix);
AddGlobalFunc('function exp(exponent: extended): extended', @Lape_exp);
AddGlobalFunc('function Max(a,b: integer): integer', @Lape_Max);
AddGlobalFunc('function Min(a, b: Integer): Integer', @Lape_Min);
AddGlobalFunc('function MinE(a, b: extended): extended', @Lape_MinE);
AddGlobalFunc('function MaxE(a,b: extended): extended', @Lape_MaxE);
AddGlobalFunc('function Sqr(e: extended): extended', @Lape_Sqr);
AddGlobalFunc('function Point(x,y: integer): TPoint', @Lape_Point);
AddGlobalFunc('function Distance(x1,y1,x2,y2: integer): integer', @Lape_Distance);
AddGlobalFunc('function Hypot(X, Y: Extended): Extended', @Lape_Hypot);
AddGlobalFunc('function RandomRange(const aFrom, aTo: Integer): Integer', @Lape_RandomRange);
AddGlobalFunc('function Random(Int: integer): integer', @Lape_Random);
AddGlobalFunc('function RandomE: extended', @Lape_RandomE);
AddGlobalFunc('function ArcTan2(y,x: extended): extended', @Lape_ArcTan2);
AddGlobalFunc('procedure IncEx(var x: integer; increase: integer);', @Lape_IncEx);
AddGlobalFunc('procedure DecEx(var x: integer; Decrease: integer);', @Lape_DecEx);
AddGlobalFunc('function Factorial(number: longword): Int64', @Lape_Factorial);
AddGlobalFunc('procedure MoveMouse(x, y: integer);', @Lape_MoveMouse);
AddGlobalFunc('procedure ScrollMouse(x,y: integer; Clicks: integer);', @Lape_ScrollMouse);
AddGlobalFunc('procedure GetMousePos(var x, y: integer);', @Lape_GetMousePos);
AddGlobalFunc('function ConvIntClickType(Int: Integer): TClickType', @Lape_ConvIntClickType);
AddGlobalFunc('procedure HoldMouse(x, y: integer; clickType: integer);', @Lape_HoldMouse);
AddGlobalFunc('procedure ReleaseMouse(x, y: integer; clickType: integer);', @Lape_ReleaseMouse);
AddGlobalFunc('procedure ClickMouse(x, y: integer; clickType: integer);', @Lape_ClickMouse);
AddGlobalFunc('function IsMouseButtonDown(button: integer): boolean', @Lape_IsMouseButtonDown);
AddGlobalFunc('function rs_GetUpText: String', @Lape_rs_GetUpText);
AddGlobalFunc('function rs_GetUpTextAtEx(x, y: integer; shadow: boolean): string', @Lape_rs_GetUpTextAtEx);
AddGlobalFunc('function rs_GetUpTextAt(x, y: integer): string', @Lape_rs_GetUpTextAt);
AddGlobalFunc('function BitmapFromText(const text, font: String): integer', @Lape_BitmapFromText);
AddGlobalFunc('procedure Writeln(const str: string);', @Lape_Writeln);
AddGlobalFunc('function SetScriptProp(prop: TSP_Property; Value: TVariantArray): boolean', @Lape_SetScriptProp);
AddGlobalFunc('function GetScriptProp(prop: TSP_Property; var Value: TVariantArray): boolean', @Lape_GetScriptProp);
AddGlobalFunc('procedure Wait(t: DWord);', @Lape_Wait);
AddGlobalFunc('function SetSettingValue(const KeyName,value: string): boolean', @Lape_SetSettingValue);
AddGlobalFunc('function KeyIsSetting(const KeyName: String): Boolean', @Lape_KeyIsSetting);
AddGlobalFunc('function KeyIsDirectory(const KeyName: String): Boolean', @Lape_KeyIsDirectory);
AddGlobalFunc('function GetSettingValue(const KeyName: String): String', @Lape_GetSettingValue);
AddGlobalFunc('function GetSettingValueDef(const KeyName, defVal: String): String', @Lape_GetSettingValueDef);
AddGlobalFunc('function ListSettings(const KeyName: String; var KeyReturn: TStringArray): boolean', @Lape_ListSettings);
AddGlobalFunc('function DeleteSetting(const KeyName: String): Boolean', @Lape_DeleteSetting);
AddGlobalFunc('function DeleteSubSettings(const KeyName: String): Boolean', @Lape_DeleteSubSettings);
AddGlobalFunc('function Capitalize(str: string): string', @Lape_Capitalize);
AddGlobalFunc('function CompressString(const Str: string): string', @Lape_CompressString);
AddGlobalFunc('function DecompressString(const Compressed: string): string', @Lape_DecompressString);
AddGlobalFunc('function Base64Encode(const str: string): string', @Lape_Base64Encode);
AddGlobalFunc('function Base64Decode(const str: string): string', @Lape_Base64Decode);
AddGlobalFunc('function ExtractFromStr(Str: string; Extract: StrExtr): string', @Lape_ExtractFromStr);
AddGlobalFunc('function BoolToStr(bool: boolean): string', @Lape_BoolToStr);
AddGlobalFunc('function Replace(Text, FindStr, ReplaceStr: string; Flags: TReplaceFlags): string', @Lape_Replace);
AddGlobalFunc('function IntToStr(int: integer): string', @Lape_IntToStr);
AddGlobalFunc('function FloatToStr(flt: extended): string', @Lape_FloatToStr);
AddGlobalFunc('function StrToInt(value: String): Integer', @Lape_StrToInt);
AddGlobalFunc('function StrToIntDef(value: String; default: Integer): Integer', @Lape_StrToIntDef);
AddGlobalFunc('function StrToFloat(value: String): Extended', @Lape_StrToFloat);
AddGlobalFunc('function StrToFloatDef(value: String; default: Extended): Extended', @Lape_StrToFloatDef);
AddGlobalFunc('function StrToBool(value: String): Boolean', @Lape_StrToBool);
AddGlobalFunc('function StrToBoolDef(value: String; default: Boolean): Boolean', @Lape_StrToBoolDef);
AddGlobalFunc('function Between(s1, s2, str: string): string', @Lape_Between);
AddGlobalFunc('procedure Quicksort(var Arr: TIntegerArray);', @Lape_Quicksort);
AddGlobalFunc('procedure tSwap(var a, b: TPoint);', @Lape_tSwap);
AddGlobalFunc('procedure tpaSwap(var a, b: TPointArray);', @Lape_tpaSwap);
AddGlobalFunc('procedure SwapE(var a, b: Extended);', @Lape_SwapE);
AddGlobalFunc('procedure RAaSTPAEx(var a: TPointArray; const w, h: Integer);', @Lape_RAaSTPAEx);
AddGlobalFunc('procedure RAaSTPA(var a: TPointArray; const Dist: Integer);', @Lape_RAaSTPA);
AddGlobalFunc('function NearbyPointInArrayEx(const P: TPoint; w, h: Integer; const a: TPointArray): Boolean', @Lape_NearbyPointInArrayEx);
AddGlobalFunc('function NearbyPointInArray(const P: TPoint; Dist: Integer; const a: TPointArray): Boolean', @Lape_NearbyPointInArray);
AddGlobalFunc('procedure QuickTPASort(var A: TIntegerArray; var B: TPointArray; iLo, iHi: Integer; SortUp: Boolean);', @Lape_QuickTPASort);
AddGlobalFunc('procedure QuickATPASort(var A: TIntegerArray; var B: T2DPointArray; iLo, iHi: Integer; SortUp: Boolean);', @Lape_QuickATPASort);
AddGlobalFunc('procedure SortTPAFrom(var a: TPointArray; const From: TPoint);', @Lape_SortTPAFrom);
AddGlobalFunc('procedure SortATPAFrom(var a: T2DPointArray; const From: TPoint);', @Lape_SortATPAFrom);
AddGlobalFunc('procedure SortATPAFromFirstPoint(var a: T2DPointArray; const From: TPoint);', @Lape_SortATPAFromFirstPoint);
AddGlobalFunc('procedure InvertTPA(var a: TPointArray);', @Lape_InvertTPA);
AddGlobalFunc('procedure InvertATPA(var a: T2DPointArray);', @Lape_InvertATPA);
AddGlobalFunc('function MiddleTPAEx(const TPA: TPointArray; var x, y: Integer): Boolean', @Lape_MiddleTPAEx);
AddGlobalFunc('function MiddleTPA(const tpa: TPointArray): TPoint', @Lape_MiddleTPA);
AddGlobalFunc('procedure SortATPASize(var a: T2DPointArray; const BigFirst: Boolean);', @Lape_SortATPASize);
AddGlobalFunc('procedure SortATPAFromSize(var a: T2DPointArray; const Size: Integer; CloseFirst: Boolean);', @Lape_SortATPAFromSize);
AddGlobalFunc('function InIntArrayEx(const a: TIntegerArray; var Where: Integer; const Number: Integer): Boolean', @Lape_InIntArrayEx);
AddGlobalFunc('function InIntArray(const a: TIntegerArray; Number: Integer): Boolean', @Lape_InIntArray);
AddGlobalFunc('procedure ClearSameIntegers(var a: TIntegerArray);', @Lape_ClearSameIntegers);
AddGlobalFunc('procedure ClearSameIntegersAndTPA(var a: TIntegerArray; var p: TPointArray);', @Lape_ClearSameIntegersAndTPA);
AddGlobalFunc('function SplitTPAEx(const arr: TPointArray; w, h: Integer): T2DPointArray', @Lape_SplitTPAEx);
AddGlobalFunc('function SplitTPA(const arr: TPointArray; Dist: Integer): T2DPointArray', @Lape_SplitTPA);
AddGlobalFunc('function FloodFillTPA(const TPA: TPointArray): T2DPointArray', @Lape_FloodFillTPA);
AddGlobalFunc('procedure FilterPointsPie(var Points: TPointArray; const SD, ED, MinR, MaxR: Extended; Mx, My: Integer);', @Lape_FilterPointsPie);
AddGlobalFunc('procedure FilterPointsDist(var Points: TPointArray; const MinDist, MaxDist: Extended; Mx, My: Integer);', @Lape_FilterPointsDist);
AddGlobalFunc('procedure FilterPointsLine(var Points: TPointArray; Radial: Extended; Radius, MX, MY: Integer);', @Lape_FilterPointsLine);
AddGlobalFunc('procedure FilterTPADist(var TPA: TPointArray; maxDist: integer);', @Lape_FilterTPADist);
AddGlobalFunc('function GetATPABounds(const ATPA: T2DPointArray): TBox', @Lape_GetATPABounds);
AddGlobalFunc('function GetTPABounds(const TPA: TPointArray): TBox', @Lape_GetTPABounds);
AddGlobalFunc('function FindTPAinTPA(const SearchTPA, TotalTPA: TPointArray; var Matches: TPointArray): Boolean', @Lape_FindTPAinTPA);
AddGlobalFunc('function GetSamePointsATPA(const ATPA: T2DPointArray; var Matches: TPointArray): boolean', @Lape_GetSamePointsATPA);
AddGlobalFunc('function FindTextTPAinTPA(Height: integer; const SearchTPA, TotalTPA: TPointArray; var Matches: TPointArray): Boolean', @Lape_FindTextTPAinTPA);
AddGlobalFunc('procedure SortCircleWise(var tpa: TPointArray; const cx, cy, StartDegree: Integer; SortUp, ClockWise: Boolean);', @Lape_SortCircleWise);
AddGlobalFunc('procedure LinearSort(var tpa: TPointArray; cx, cy, sd: Integer; SortUp: Boolean);', @Lape_LinearSort);
AddGlobalFunc('function RotatePoint(Const p: TPoint; angle, mx, my: Extended): TPoint', @Lape_RotatePoint);
AddGlobalFunc('function ChangeDistPT(const PT: TPoint; mx,my: integer; newdist: extended): TPoint', @Lape_ChangeDistPT);
AddGlobalFunc('function ChangeDistTPA(var TPA: TPointArray; mx,my: integer; newdist: extended): boolean', @Lape_ChangeDistTPA);
AddGlobalFunc('function FindGapsTPA(const TPA: TPointArray; MinPixels: Integer): T2DPointArray', @Lape_FindGapsTPA);
AddGlobalFunc('function RemoveDistTPointArray(x, y, dist: Integer; const ThePoints: TPointArray; RemoveHigher: Boolean): TPointArray', @Lape_RemoveDistTPointArray);
AddGlobalFunc('function CombineTPA(const Ar1, Ar2: TPointArray): TPointArray', @Lape_CombineTPA);
AddGlobalFunc('function ReArrangeandShortenArrayEx(const a: TPointArray; w, h: Integer): TPointArray', @Lape_ReArrangeandShortenArrayEx);
AddGlobalFunc('function ReArrangeandShortenArray(const a: TPointArray; Dist: Integer): TPointArray', @Lape_ReArrangeandShortenArray);
AddGlobalFunc('function TPAtoATPAEx(const TPA: TPointArray; w, h: Integer): T2DPointArray', @Lape_TPAtoATPAEx);
AddGlobalFunc('function TPAtoATPA(const TPA: TPointArray; Dist: Integer): T2DPointArray', @Lape_TPAtoATPA);
AddGlobalFunc('function CombineIntArray(const Ar1, Ar2: TIntegerArray): TIntegerArray', @Lape_CombineIntArray);
AddGlobalFunc('function MergeATPA(const ATPA: T2DPointArray): TPointArray', @Lape_MergeATPA);
AddGlobalFunc('procedure AppendTPA(var TPA: TPointArray; const ToAppend: TPointArray);', @Lape_AppendTPA);
AddGlobalFunc('function TPAFromBox(const Box: TBox): TPointArray', @Lape_TPAFromBox);
AddGlobalFunc('function RotatePoints(Const P: TPointArray; A, cx, cy: Extended): TPointArray', @Lape_RotatePoints);
AddGlobalFunc('function FindTPAEdges(const p: TPointArray): TPointArray', @Lape_FindTPAEdges);
AddGlobalFunc('function ClearTPAFromTPA(const arP, ClearPoints: TPointArray): TPointArray', @Lape_ClearTPAFromTPA);
AddGlobalFunc('function ReturnPointsNotInTPA(Const TotalTPA: TPointArray; const Box: TBox): TPointArray', @Lape_ReturnPointsNotInTPA);
AddGlobalFunc('function PointInTPA(p: TPoint; const arP: TPointArray): Boolean', @Lape_PointInTPA);
AddGlobalFunc('procedure ClearDoubleTPA(var TPA: TPointArray);', @Lape_ClearDoubleTPA);
AddGlobalFunc('procedure TPACountSort(Var TPA: TPointArray; const max: TPoint; Const SortOnX: Boolean);', @Lape_TPACountSort);
AddGlobalFunc('procedure TPACountSortBase(Var TPA: TPointArray; const maxx, base: TPoint; const SortOnX: Boolean);', @Lape_TPACountSortBase);
AddGlobalFunc('procedure InvertTIA(var tI: TIntegerArray);', @Lape_InvertTIA);
AddGlobalFunc('function SumIntegerArray(const Ints: TIntegerArray): Integer', @Lape_SumIntegerArray);
AddGlobalFunc('function AverageTIA(const tI: TIntegerArray): Integer', @Lape_AverageTIA);
AddGlobalFunc('function AverageExtended(const tE: TExtendedArray): Extended', @Lape_AverageExtended);
AddGlobalFunc('procedure SplitTPAExWrap(const arr: TPointArray; w, h: Integer; var res: T2DPointArray);', @Lape_SplitTPAExWrap);
AddGlobalFunc('procedure SplitTPAWrap(const arr: TPointArray; Dist: Integer; var res: T2DPointArray);', @Lape_SplitTPAWrap);
AddGlobalFunc('procedure FindGapsTPAWrap(const TPA: TPointArray; MinPixels: Integer; var Res: T2DPointArray);', @Lape_FindGapsTPAWrap);
AddGlobalFunc('procedure RemoveDistTPointArrayWrap(x, y, dist: Integer; const ThePoints: TPointArray; RemoveHigher: Boolean; var Res: TPointArray);', @Lape_RemoveDistTPointArrayWrap);
AddGlobalFunc('procedure CombineTPAWrap(const Ar1, Ar2: TPointArray; var Res: TPointArray);', @Lape_CombineTPAWrap);
AddGlobalFunc('procedure ReArrangeandShortenArrayExWrap(const a: TPointArray; w, h: Integer; var Res: TPointArray);', @Lape_ReArrangeandShortenArrayExWrap);
AddGlobalFunc('procedure ReArrangeandShortenArrayWrap(const a: TPointArray; Dist: Integer; var Res: TPointArray);', @Lape_ReArrangeandShortenArrayWrap);
AddGlobalFunc('procedure TPAtoATPAExWrap(const TPA: TPointArray; w, h: Integer; var Res: T2DPointArray);', @Lape_TPAtoATPAExWrap);
AddGlobalFunc('procedure TPAtoATPAWrap(const TPA: TPointArray; Dist: Integer; var Res: T2DPointArray);', @Lape_TPAtoATPAWrap);
AddGlobalFunc('procedure CombineIntArrayWrap(const Ar1, Ar2: TIntegerArray; var Res: TIntegerArray);', @Lape_CombineIntArrayWrap);
AddGlobalFunc('procedure MergeATPAWrap(const ATPA: T2DPointArray; var Res: TPointArray);', @Lape_MergeATPAWrap);
AddGlobalFunc('procedure TPAFromBoxWrap(const Box: TBox; var Res: TPointArray);', @Lape_TPAFromBoxWrap);
AddGlobalFunc('procedure RotatePointsWrap(Const P: TPointArray; A, cx, cy: Extended; var Res: TPointArray);', @Lape_RotatePointsWrap);
AddGlobalFunc('procedure FindTPAEdgesWrap(const p: TPointArray; var Res: TPointArray);', @Lape_FindTPAEdgesWrap);
AddGlobalFunc('procedure ClearTPAFromTPAWrap(const arP, ClearPoints: TPointArray; var Res: TPointArray);', @Lape_ClearTPAFromTPAWrap);
AddGlobalFunc('procedure ReturnPointsNotInTPAWrap(Const TotalTPA: TPointArray; const Box: TBox; var Res: TPointArray);', @Lape_ReturnPointsNotInTPAWrap);
AddGlobalFunc('function SameTPA(const aTPA, bTPA: TPointArray): Boolean', @Lape_SameTPA);
AddGlobalFunc('function TPAInATPA(const TPA: TPointArray; const InATPA: T2DPointArray; var Index: LongInt): Boolean', @Lape_TPAInATPA);
AddGlobalFunc('procedure OffsetTPA(var TPA: TPointArray; const Offset: TPoint);', @Lape_OffsetTPA);
AddGlobalFunc('procedure OffsetATPA(var ATPA: T2DPointArray; const Offset: TPoint);', @Lape_OffsetATPA);
AddGlobalFunc('function CopyTPA(const TPA: TPointArray): TPointArray', @Lape_CopyTPA);
AddGlobalFunc('function CopyATPA(const ATPA: T2DPointArray): T2DPointArray', @Lape_CopyATPA);
AddGlobalFunc('procedure SetDesktopAsClient;', @Lape_SetDesktopAsClient);
AddGlobalFunc('function SetTargetArray(P: Integer; w, h: integer): integer', @Lape_SetTargetArray);
AddGlobalFunc('function SetTargetBitmap(bitmap: Integer): integer', @Lape_SetTargetBitmap);
AddGlobalFunc('function SetEIOSTarget(name: string; args: Variant): integer', @Lape_SetEIOSTarget);
AddGlobalFunc('procedure SetImageTarget(idx: integer);', @Lape_SetImageTarget);
AddGlobalFunc('procedure SetKeyMouseTarget(idx: integer);', @Lape_SetKeyMouseTarget);
AddGlobalFunc('function GetImageTarget: integer', @Lape_GetImageTarget);
AddGlobalFunc('function GetKeyMouseTarget: integer', @Lape_GetKeyMouseTarget);
AddGlobalFunc('function ExportImageTarget: TTarget_Exported', @Lape_ExportImageTarget);
AddGlobalFunc('function ExportKeyMouseTarget: TTarget_Exported', @Lape_ExportKeyMouseTarget);
AddGlobalFunc('procedure FreeTarget(idx: integer);', @Lape_FreeTarget);
AddGlobalFunc('procedure GetClientDimensions(var w, h: integer);', @Lape_GetClientDimensions);
AddGlobalFunc('procedure GetClientPosition(var left, top: integer);', @Lape_GetClientPosition);
AddGlobalFunc('function Freeze: boolean', @Lape_Freeze);
AddGlobalFunc('function Unfreeze: boolean', @Lape_Unfreeze);
AddGlobalFunc('procedure ActivateClient;', @Lape_ActivateClient);
AddGlobalFunc('function IsTargetValid: boolean', @Lape_IsTargetValid);

View File

@ -23,8 +23,9 @@
unit mmlpsthread;
{$Define PS_USESSUPPORT}
{$define PS_USESSUPPORT}
//{$define USE_RUTIS}
{$define USE_LAPE}
{$mode objfpc}{$H+}
interface
@ -35,9 +36,12 @@ uses
bitmaps, plugins, dynlibs,internets,scriptproperties,
settings,settingssandbox, lcltype, dialogs
{$IFDEF USE_RUTIS}
,Rutis_Engine,Rutis_Defs
, Rutis_Engine, Rutis_Defs
{$ENDIF}
;
{$IFDEF USE_LAPE}
, lpparser, lpcompiler, lptypes, lpvartypes,
lpeval, lpinterpreter, lpdisassembler
{$ENDIF};
const
m_Status = 0; //Data = PChar to new status
@ -233,6 +237,24 @@ type
end;
{$ENDIF}
{$IFDEF USE_LAPE}
{ TLPThread }
TLPThread = class(TMThread)
protected
procedure LoadPlugin(plugidx: integer); override;
public
Parser: TLapeTokenizerString;
Compiler: TLapeCompiler;
constructor Create(CreateSuspended: Boolean; TheSyncInfo : PSyncInfo; plugin_dir: string);
destructor Destroy; override;
procedure SetScript(Script: string); override;
procedure Execute; override;
procedure Terminate; override;
function OnFindFile(Sender: TLapeCompiler; var FileName: lpString): TLapeTokenizerBase;
function OnHandleDirective(Sender: TLapeCompiler; Directive, Argument: lpString; InPeek: Boolean): Boolean;
end;
{$ENDIF}
threadvar
CurrThread : TMThread;
@ -685,7 +707,6 @@ begin
end;
end;
procedure TPSThread.LoadPlugin(plugidx: integer);
var
i: integer;
@ -1229,6 +1250,183 @@ begin
end;
{$ENDIF}
{$IFDEF USE_LAPE}
{ TLPThread }
type
PBoolean = ^Boolean;
PStringArray = ^TStringArray;
PBmpMirrorStyle = ^TBmpMirrorStyle;
PPointArray = ^TPointArray;
P2DIntArray = ^T2DIntArray;
PCanvas = ^TCanvas;
P2DPointArray = ^T2DPointArray;
PMask = ^TMask;
PBox = ^TBox;
PTarget_Exported = ^TTarget_Exported;
PIntegerArray = ^TIntegerArray;
PExtendedArray = ^TExtendedArray;
PFont = ^TFont;
// PStrExtr = ^TStrExtr;
PReplaceFlags = ^TReplaceFlags;
PClickType = ^TClickType;
P2DExtendedArray = ^T2DExtendedArray;
PMDTM = ^TMDTM;
PMDTMPoint = ^TMDTMPoint;
PSDTM = ^TSDTM;
procedure lp_WriteLn(Params: PParamArray);
begin
psWriteLn(PlpString(Params^[0])^);
end;
{$I LPInc/Wrappers/other.inc}
{$I LPInc/Wrappers/settings.inc}
{$I LPInc/Wrappers/bitmap.inc}
{$I LPInc/Wrappers/window.inc}
{$I LPInc/Wrappers/tpa.inc}
{$I LPInc/Wrappers/strings.inc}
{$I LPInc/Wrappers/colour.inc}
{$I LPInc/Wrappers/colourconv.inc}
{$I LPInc/Wrappers/crypto.inc}
{$I LPInc/Wrappers/math.inc}
{$I LPInc/Wrappers/mouse.inc}
{$I LPInc/Wrappers/file.inc}
{$I LPInc/Wrappers/keyboard.inc}
{$I LPInc/Wrappers/dtm.inc}
{.$I LPInc/Wrappers/extensions.inc} //Doesn't work for me!
{$I LPInc/Wrappers/ocr.inc}
{$I LPInc/Wrappers/internets.inc}
constructor TLPThread.Create(CreateSuspended: Boolean; TheSyncInfo: PSyncInfo; plugin_dir: string);
var
I: integer;
Fonts: TMFonts;
begin
inherited Create(CreateSuspended, TheSyncInfo, plugin_dir);
Parser := TLapeTokenizerString.Create('');
Compiler := TLapeCompiler.Create(Parser);
Compiler.OnFindFile := @OnFindFile;
Compiler.OnHandleDirective := @OnHandleDirective;
Fonts := Client.MOCR.Fonts;
with Compiler do
begin
addGlobalFunc('procedure _writeln; override;', @lp_WriteLn);
for I := Fonts.Count - 1 downto 0 do
addGlobalVar(Fonts[I].Name, Fonts[I].Name);
for I := 0 to High(VirtualKeys) do
addGlobalVar(VirtualKeys[I].Key, Format('VK_%S', [VirtualKeys[i].Str]));
{$I LPInc/lpdefines.inc}
{$I LPInc/lpcompile.inc}
{$I LPInc/lpexportedmethods.inc}
end;
end;
destructor TLPThread.Destroy;
begin
try
{if (Compiler <> nil) then
Compiler.Free;}
if (Parser <> nil) then
Parser.Free;
except
on E: Exception do
psWriteln('Exception TLPThread.Destroy: ' + e.message);
end;
inherited Destroy;
end;
procedure TLPThread.SetScript(Script: string);
begin
Parser.Doc := Script;
end;
function TLPThread.OnFindFile(Sender: TLapeCompiler; var FileName: lpString): TLapeTokenizerBase;
begin
Result := nil;
FileName := IncludePath + FileName;
end;
function TLPThread.OnHandleDirective(Sender: TLapeCompiler; Directive, Argument: lpString; InPeek: Boolean): Boolean;
var
plugin_idx: integer;
begin
Result := False;
if (Directive = 'loadlib') then
begin
if (Argument <> '') then
begin
plugin_idx := PluginsGlob.LoadPlugin(Argument);
if (plugin_idx >= 0) then
begin
LoadPlugin(plugin_idx);
Result := True;
end else
psWriteln(Format('Your DLL %s has not been found', [Argument]))
end else
psWriteln('Your LoadLib directive has no params, thus cannot find the plugin');
end;
end;
procedure TLPThread.LoadPlugin(plugidx: integer);
var
I: integer;
begin
with PluginsGlob.MPlugins[plugidx] do
begin
for i := 0 to TypesLen -1 do
with Types[I] do
Compiler.addGlobalType(TypeDef, TypeName);
for i := 0 to MethodLen - 1 do
with Methods[i] do
Compiler.addGlobalFunc(FuncStr, FuncPtr);
end;
end;
procedure TLPThread.Execute;
function CombineDeclArray(a, b: TLapeDeclArray): TLapeDeclArray;
var
i, l: Integer;
begin
Result := a;
l := Length(a);
SetLength(Result, l + Length(b));
for i := High(b) downto 0 do
Result[l + i] := b[i];
end;
begin
CurrThread := self;
try
Starttime := lclintf.GetTickCount;
if Compiler.Compile() then
begin
psWriteln('Compiled succesfully in ' + IntToStr(GetTickCount - Starttime) + ' ms.');
if CompileOnly then
Exit;
RunCode(Compiler.Emitter.Code);
psWriteln('Successfully executed.');
end else
psWriteln('Compiling failed.');
except
on E : Exception do
psWriteln('Exception in Script: ' + e.message);
end;
end;
procedure TLPThread.Terminate;
begin
end;
{$ENDIF}
initialization
PluginsGlob := TMPlugins.Create;
libcpascal:= 0;

@ -1 +1 @@
Subproject commit b24c52b9748c6f9f3e91a7a86f727022bf2fd6ce
Subproject commit 91f6956ba801992efc5894e77888b84a987edadd