diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4ab43a4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Units/lape"] + path = Units/lape + url = git://villavu.com/lape.git diff --git a/Projects/Simba/Simba.inc b/Projects/Simba/Simba.inc index 9273f5c..1773703 100644 --- a/Projects/Simba/Simba.inc +++ b/Projects/Simba/Simba.inc @@ -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 diff --git a/Projects/Simba/Simba.lpi b/Projects/Simba/Simba.lpi index 889e59c..3d3d76c 100644 --- a/Projects/Simba/Simba.lpi +++ b/Projects/Simba/Simba.lpi @@ -321,8 +321,8 @@ - - + + diff --git a/Projects/Simba/simbaunit.lfm b/Projects/Simba/simbaunit.lfm index f396c98..2c3814c 100644 --- a/Projects/Simba/simbaunit.lfm +++ b/Projects/Simba/simbaunit.lfm @@ -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 diff --git a/Projects/Simba/simbaunit.pas b/Projects/Simba/simbaunit.pas index 0a828a2..3ba1ae2 100644 --- a/Projects/Simba/simbaunit.pas +++ b/Projects/Simba/simbaunit.pas @@ -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'); - Exit; + 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,26 +1772,29 @@ 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; end; - interp_RT : result := 'program untitled;' + LineEnding + lineEnding + 'interface' + LineEnding + LineEnding + - 'implementation' + LineEnding + LineEnding + 'begin' + LineEnding + 'end.' + LineEnding; + 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; diff --git a/Projects/lape-wrappers/main.lfm b/Projects/lape-wrappers/main.lfm new file mode 100644 index 0000000..aa9b137 --- /dev/null +++ b/Projects/lape-wrappers/main.lfm @@ -0,0 +1,2226 @@ +object frmMain: TfrmMain + Left = 367 + Height = 419 + Top = 147 + Width = 708 + Caption = 'Wrap da Wrap' + ClientHeight = 419 + ClientWidth = 708 + LCLVersion = '0.9.29' + inline eIn: TSynEdit + Left = 0 + Height = 224 + Top = 0 + Width = 335 + Align = alClient + Font.Height = -13 + Font.Name = 'Courier New' + Font.Pitch = fpFixed + Font.Quality = fqNonAntialiased + ParentColor = False + ParentFont = False + TabOrder = 0 + Gutter.Width = 57 + Gutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + RightGutter.Width = 0 + RightGutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Highlighter = PasHL + Keystrokes = < + item + Command = ecUp + ShortCut = 38 + end + item + Command = ecSelUp + ShortCut = 8230 + end + item + Command = ecScrollUp + ShortCut = 16422 + end + item + Command = ecDown + ShortCut = 40 + end + item + Command = ecSelDown + ShortCut = 8232 + end + item + Command = ecScrollDown + ShortCut = 16424 + end + item + Command = ecLeft + ShortCut = 37 + end + item + Command = ecSelLeft + ShortCut = 8229 + end + item + Command = ecWordLeft + ShortCut = 16421 + end + item + Command = ecSelWordLeft + ShortCut = 24613 + end + item + Command = ecRight + ShortCut = 39 + end + item + Command = ecSelRight + ShortCut = 8231 + end + item + Command = ecWordRight + ShortCut = 16423 + end + item + Command = ecSelWordRight + ShortCut = 24615 + end + item + Command = ecPageDown + ShortCut = 34 + end + item + Command = ecSelPageDown + ShortCut = 8226 + end + item + Command = ecPageBottom + ShortCut = 16418 + end + item + Command = ecSelPageBottom + ShortCut = 24610 + end + item + Command = ecPageUp + ShortCut = 33 + end + item + Command = ecSelPageUp + ShortCut = 8225 + end + item + Command = ecPageTop + ShortCut = 16417 + end + item + Command = ecSelPageTop + ShortCut = 24609 + end + item + Command = ecLineStart + ShortCut = 36 + end + item + Command = ecSelLineStart + ShortCut = 8228 + end + item + Command = ecEditorTop + ShortCut = 16420 + end + item + Command = ecSelEditorTop + ShortCut = 24612 + end + item + Command = ecLineEnd + ShortCut = 35 + end + item + Command = ecSelLineEnd + ShortCut = 8227 + end + item + Command = ecEditorBottom + ShortCut = 16419 + end + item + Command = ecSelEditorBottom + ShortCut = 24611 + end + item + Command = ecToggleMode + ShortCut = 45 + end + item + Command = ecCopy + ShortCut = 16429 + end + item + Command = ecPaste + ShortCut = 8237 + end + item + Command = ecDeleteChar + ShortCut = 46 + end + item + Command = ecCut + ShortCut = 8238 + end + item + Command = ecDeleteLastChar + ShortCut = 8 + end + item + Command = ecDeleteLastChar + ShortCut = 8200 + end + item + Command = ecDeleteLastWord + ShortCut = 16392 + end + item + Command = ecUndo + ShortCut = 32776 + end + item + Command = ecRedo + ShortCut = 40968 + end + item + Command = ecLineBreak + ShortCut = 13 + end + item + Command = ecSelectAll + ShortCut = 16449 + end + item + Command = ecCopy + ShortCut = 16451 + end + item + Command = ecBlockIndent + ShortCut = 24649 + end + item + Command = ecLineBreak + ShortCut = 16461 + end + item + Command = ecInsertLine + ShortCut = 16462 + end + item + Command = ecDeleteWord + ShortCut = 16468 + end + item + Command = ecBlockUnindent + ShortCut = 24661 + end + item + Command = ecPaste + ShortCut = 16470 + end + item + Command = ecCut + ShortCut = 16472 + end + item + Command = ecDeleteLine + ShortCut = 16473 + end + item + Command = ecDeleteEOL + ShortCut = 24665 + end + item + Command = ecUndo + ShortCut = 16474 + end + item + Command = ecRedo + ShortCut = 24666 + end + item + Command = ecGotoMarker0 + ShortCut = 16432 + end + item + Command = ecGotoMarker1 + ShortCut = 16433 + end + item + Command = ecGotoMarker2 + ShortCut = 16434 + end + item + Command = ecGotoMarker3 + ShortCut = 16435 + end + item + Command = ecGotoMarker4 + ShortCut = 16436 + end + item + Command = ecGotoMarker5 + ShortCut = 16437 + end + item + Command = ecGotoMarker6 + ShortCut = 16438 + end + item + Command = ecGotoMarker7 + ShortCut = 16439 + end + item + Command = ecGotoMarker8 + ShortCut = 16440 + end + item + Command = ecGotoMarker9 + ShortCut = 16441 + end + item + Command = ecSetMarker0 + ShortCut = 24624 + end + item + Command = ecSetMarker1 + ShortCut = 24625 + end + item + Command = ecSetMarker2 + ShortCut = 24626 + end + item + Command = ecSetMarker3 + ShortCut = 24627 + end + item + Command = ecSetMarker4 + ShortCut = 24628 + end + item + Command = ecSetMarker5 + ShortCut = 24629 + end + item + Command = ecSetMarker6 + ShortCut = 24630 + end + item + Command = ecSetMarker7 + ShortCut = 24631 + end + item + Command = ecSetMarker8 + ShortCut = 24632 + end + item + Command = ecSetMarker9 + ShortCut = 24633 + end + item + Command = EcFoldLevel1 + ShortCut = 41009 + end + item + Command = EcFoldLevel2 + ShortCut = 41010 + end + item + Command = EcFoldLevel1 + ShortCut = 41011 + end + item + Command = EcFoldLevel1 + ShortCut = 41012 + end + item + Command = EcFoldLevel1 + ShortCut = 41013 + end + item + Command = EcFoldLevel6 + ShortCut = 41014 + end + item + Command = EcFoldLevel7 + ShortCut = 41015 + end + item + Command = EcFoldLevel8 + ShortCut = 41016 + end + item + Command = EcFoldLevel9 + ShortCut = 41017 + end + item + Command = EcFoldLevel0 + ShortCut = 41008 + end + item + Command = EcFoldCurrent + ShortCut = 41005 + end + item + Command = EcUnFoldCurrent + ShortCut = 41003 + end + item + Command = EcToggleMarkupWord + ShortCut = 32845 + end + item + Command = ecNormalSelect + ShortCut = 24654 + end + item + Command = ecColumnSelect + ShortCut = 24643 + end + item + Command = ecLineSelect + ShortCut = 24652 + end + item + Command = ecTab + ShortCut = 9 + end + item + Command = ecShiftTab + ShortCut = 8201 + end + item + Command = ecMatchBracket + ShortCut = 24642 + end + item + Command = ecColSelUp + ShortCut = 40998 + end + item + Command = ecColSelDown + ShortCut = 41000 + end + item + Command = ecColSelLeft + ShortCut = 40997 + end + item + Command = ecColSelRight + ShortCut = 40999 + end + item + Command = ecColSelPageDown + ShortCut = 40994 + end + item + Command = ecColSelPageBottom + ShortCut = 57378 + end + item + Command = ecColSelPageUp + ShortCut = 40993 + end + item + Command = ecColSelPageTop + ShortCut = 57377 + end + item + Command = ecColSelLineStart + ShortCut = 40996 + end + item + Command = ecColSelLineEnd + ShortCut = 40995 + end + item + Command = ecColSelEditorTop + ShortCut = 57380 + end + item + Command = ecColSelEditorBottom + ShortCut = 57379 + end> + MouseActions = < + item + Shift = [] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift, ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccDouble + ClickDir = cdDown + Command = 6 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccTriple + ClickDir = cdDown + Command = 7 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccQuad + ClickDir = cdDown + Command = 8 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbMiddle + ClickCount = ccSingle + ClickDir = cdDown + Command = 10 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssCtrl] + ShiftMask = [ssShift, ssAlt, ssCtrl] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdUp + Command = 11 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseSelActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 9 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Lines.Strings = ( + 'Input' + ) + BracketHighlightStyle = sbhsBoth + inline SynLeftGutterPartList1: TSynGutterPartList + object SynGutterMarks1: TSynGutterMarks + Width = 24 + end + object SynGutterLineNumber1: TSynGutterLineNumber + Width = 17 + MouseActions = <> + MarkupInfo.Background = clBtnFace + MarkupInfo.Foreground = clNone + DigitCount = 2 + ShowOnlyLineNumbersMultiplesOf = 1 + ZeroStart = False + LeadingZeros = False + end + object SynGutterChanges1: TSynGutterChanges + Width = 4 + ModifiedColor = 59900 + SavedColor = clGreen + end + object SynGutterSeparator1: TSynGutterSeparator + Width = 2 + end + object SynGutterCodeFolding1: TSynGutterCodeFolding + MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 16 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 0 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MarkupInfo.Background = clNone + MarkupInfo.Foreground = clGray + MouseActionsExpanded = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseActionsCollapsed = < + item + Shift = [ssCtrl] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 1 + Priority = 0 + end> + end + end + inline SynRightGutterPartList1: TSynRightGutterPartList + end + end + inline eOut: TSynEdit + Left = 340 + Height = 224 + Top = 0 + Width = 368 + Align = alRight + Font.Height = -13 + Font.Name = 'Courier New' + Font.Pitch = fpFixed + Font.Quality = fqNonAntialiased + ParentColor = False + ParentFont = False + TabOrder = 1 + Gutter.Width = 57 + Gutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + RightGutter.Width = 0 + RightGutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Highlighter = PasHL + Keystrokes = < + item + Command = ecUp + ShortCut = 38 + end + item + Command = ecSelUp + ShortCut = 8230 + end + item + Command = ecScrollUp + ShortCut = 16422 + end + item + Command = ecDown + ShortCut = 40 + end + item + Command = ecSelDown + ShortCut = 8232 + end + item + Command = ecScrollDown + ShortCut = 16424 + end + item + Command = ecLeft + ShortCut = 37 + end + item + Command = ecSelLeft + ShortCut = 8229 + end + item + Command = ecWordLeft + ShortCut = 16421 + end + item + Command = ecSelWordLeft + ShortCut = 24613 + end + item + Command = ecRight + ShortCut = 39 + end + item + Command = ecSelRight + ShortCut = 8231 + end + item + Command = ecWordRight + ShortCut = 16423 + end + item + Command = ecSelWordRight + ShortCut = 24615 + end + item + Command = ecPageDown + ShortCut = 34 + end + item + Command = ecSelPageDown + ShortCut = 8226 + end + item + Command = ecPageBottom + ShortCut = 16418 + end + item + Command = ecSelPageBottom + ShortCut = 24610 + end + item + Command = ecPageUp + ShortCut = 33 + end + item + Command = ecSelPageUp + ShortCut = 8225 + end + item + Command = ecPageTop + ShortCut = 16417 + end + item + Command = ecSelPageTop + ShortCut = 24609 + end + item + Command = ecLineStart + ShortCut = 36 + end + item + Command = ecSelLineStart + ShortCut = 8228 + end + item + Command = ecEditorTop + ShortCut = 16420 + end + item + Command = ecSelEditorTop + ShortCut = 24612 + end + item + Command = ecLineEnd + ShortCut = 35 + end + item + Command = ecSelLineEnd + ShortCut = 8227 + end + item + Command = ecEditorBottom + ShortCut = 16419 + end + item + Command = ecSelEditorBottom + ShortCut = 24611 + end + item + Command = ecToggleMode + ShortCut = 45 + end + item + Command = ecCopy + ShortCut = 16429 + end + item + Command = ecPaste + ShortCut = 8237 + end + item + Command = ecDeleteChar + ShortCut = 46 + end + item + Command = ecCut + ShortCut = 8238 + end + item + Command = ecDeleteLastChar + ShortCut = 8 + end + item + Command = ecDeleteLastChar + ShortCut = 8200 + end + item + Command = ecDeleteLastWord + ShortCut = 16392 + end + item + Command = ecUndo + ShortCut = 32776 + end + item + Command = ecRedo + ShortCut = 40968 + end + item + Command = ecLineBreak + ShortCut = 13 + end + item + Command = ecSelectAll + ShortCut = 16449 + end + item + Command = ecCopy + ShortCut = 16451 + end + item + Command = ecBlockIndent + ShortCut = 24649 + end + item + Command = ecLineBreak + ShortCut = 16461 + end + item + Command = ecInsertLine + ShortCut = 16462 + end + item + Command = ecDeleteWord + ShortCut = 16468 + end + item + Command = ecBlockUnindent + ShortCut = 24661 + end + item + Command = ecPaste + ShortCut = 16470 + end + item + Command = ecCut + ShortCut = 16472 + end + item + Command = ecDeleteLine + ShortCut = 16473 + end + item + Command = ecDeleteEOL + ShortCut = 24665 + end + item + Command = ecUndo + ShortCut = 16474 + end + item + Command = ecRedo + ShortCut = 24666 + end + item + Command = ecGotoMarker0 + ShortCut = 16432 + end + item + Command = ecGotoMarker1 + ShortCut = 16433 + end + item + Command = ecGotoMarker2 + ShortCut = 16434 + end + item + Command = ecGotoMarker3 + ShortCut = 16435 + end + item + Command = ecGotoMarker4 + ShortCut = 16436 + end + item + Command = ecGotoMarker5 + ShortCut = 16437 + end + item + Command = ecGotoMarker6 + ShortCut = 16438 + end + item + Command = ecGotoMarker7 + ShortCut = 16439 + end + item + Command = ecGotoMarker8 + ShortCut = 16440 + end + item + Command = ecGotoMarker9 + ShortCut = 16441 + end + item + Command = ecSetMarker0 + ShortCut = 24624 + end + item + Command = ecSetMarker1 + ShortCut = 24625 + end + item + Command = ecSetMarker2 + ShortCut = 24626 + end + item + Command = ecSetMarker3 + ShortCut = 24627 + end + item + Command = ecSetMarker4 + ShortCut = 24628 + end + item + Command = ecSetMarker5 + ShortCut = 24629 + end + item + Command = ecSetMarker6 + ShortCut = 24630 + end + item + Command = ecSetMarker7 + ShortCut = 24631 + end + item + Command = ecSetMarker8 + ShortCut = 24632 + end + item + Command = ecSetMarker9 + ShortCut = 24633 + end + item + Command = EcFoldLevel1 + ShortCut = 41009 + end + item + Command = EcFoldLevel2 + ShortCut = 41010 + end + item + Command = EcFoldLevel1 + ShortCut = 41011 + end + item + Command = EcFoldLevel1 + ShortCut = 41012 + end + item + Command = EcFoldLevel1 + ShortCut = 41013 + end + item + Command = EcFoldLevel6 + ShortCut = 41014 + end + item + Command = EcFoldLevel7 + ShortCut = 41015 + end + item + Command = EcFoldLevel8 + ShortCut = 41016 + end + item + Command = EcFoldLevel9 + ShortCut = 41017 + end + item + Command = EcFoldLevel0 + ShortCut = 41008 + end + item + Command = EcFoldCurrent + ShortCut = 41005 + end + item + Command = EcUnFoldCurrent + ShortCut = 41003 + end + item + Command = EcToggleMarkupWord + ShortCut = 32845 + end + item + Command = ecNormalSelect + ShortCut = 24654 + end + item + Command = ecColumnSelect + ShortCut = 24643 + end + item + Command = ecLineSelect + ShortCut = 24652 + end + item + Command = ecTab + ShortCut = 9 + end + item + Command = ecShiftTab + ShortCut = 8201 + end + item + Command = ecMatchBracket + ShortCut = 24642 + end + item + Command = ecColSelUp + ShortCut = 40998 + end + item + Command = ecColSelDown + ShortCut = 41000 + end + item + Command = ecColSelLeft + ShortCut = 40997 + end + item + Command = ecColSelRight + ShortCut = 40999 + end + item + Command = ecColSelPageDown + ShortCut = 40994 + end + item + Command = ecColSelPageBottom + ShortCut = 57378 + end + item + Command = ecColSelPageUp + ShortCut = 40993 + end + item + Command = ecColSelPageTop + ShortCut = 57377 + end + item + Command = ecColSelLineStart + ShortCut = 40996 + end + item + Command = ecColSelLineEnd + ShortCut = 40995 + end + item + Command = ecColSelEditorTop + ShortCut = 57380 + end + item + Command = ecColSelEditorBottom + ShortCut = 57379 + end> + MouseActions = < + item + Shift = [] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift, ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccDouble + ClickDir = cdDown + Command = 6 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccTriple + ClickDir = cdDown + Command = 7 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccQuad + ClickDir = cdDown + Command = 8 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbMiddle + ClickCount = ccSingle + ClickDir = cdDown + Command = 10 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssCtrl] + ShiftMask = [ssShift, ssAlt, ssCtrl] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdUp + Command = 11 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseSelActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 9 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Lines.Strings = ( + 'Output' + ) + BracketHighlightStyle = sbhsBoth + inline SynLeftGutterPartList1: TSynGutterPartList + object SynGutterMarks1: TSynGutterMarks + Width = 24 + end + object SynGutterLineNumber1: TSynGutterLineNumber + Width = 17 + MouseActions = <> + MarkupInfo.Background = clBtnFace + MarkupInfo.Foreground = clNone + DigitCount = 2 + ShowOnlyLineNumbersMultiplesOf = 1 + ZeroStart = False + LeadingZeros = False + end + object SynGutterChanges1: TSynGutterChanges + Width = 4 + ModifiedColor = 59900 + SavedColor = clGreen + end + object SynGutterSeparator1: TSynGutterSeparator + Width = 2 + end + object SynGutterCodeFolding1: TSynGutterCodeFolding + MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 16 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 0 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MarkupInfo.Background = clNone + MarkupInfo.Foreground = clGray + MouseActionsExpanded = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseActionsCollapsed = < + item + Shift = [ssCtrl] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 1 + Priority = 0 + end> + end + end + inline SynRightGutterPartList1: TSynRightGutterPartList + end + end + object pnlMain: TPanel + Left = 0 + Height = 190 + Top = 229 + Width = 708 + Align = alBottom + ClientHeight = 190 + ClientWidth = 708 + TabOrder = 2 + object btnGo: TButton + Left = 8 + Height = 25 + Top = 5 + Width = 75 + Caption = 'Go!' + OnClick = btnGoClick + TabOrder = 0 + end + inline eDebug: TSynEdit + Left = 2 + Height = 150 + Top = 40 + Width = 706 + Align = alCustom + Anchors = [akTop, akLeft, akRight, akBottom] + Font.Height = -13 + Font.Name = 'Courier New' + Font.Pitch = fpFixed + Font.Quality = fqNonAntialiased + ParentColor = False + ParentFont = False + TabOrder = 1 + Gutter.Width = 57 + Gutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + RightGutter.Width = 0 + RightGutter.MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 13 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Keystrokes = < + item + Command = ecUp + ShortCut = 38 + end + item + Command = ecSelUp + ShortCut = 8230 + end + item + Command = ecScrollUp + ShortCut = 16422 + end + item + Command = ecDown + ShortCut = 40 + end + item + Command = ecSelDown + ShortCut = 8232 + end + item + Command = ecScrollDown + ShortCut = 16424 + end + item + Command = ecLeft + ShortCut = 37 + end + item + Command = ecSelLeft + ShortCut = 8229 + end + item + Command = ecWordLeft + ShortCut = 16421 + end + item + Command = ecSelWordLeft + ShortCut = 24613 + end + item + Command = ecRight + ShortCut = 39 + end + item + Command = ecSelRight + ShortCut = 8231 + end + item + Command = ecWordRight + ShortCut = 16423 + end + item + Command = ecSelWordRight + ShortCut = 24615 + end + item + Command = ecPageDown + ShortCut = 34 + end + item + Command = ecSelPageDown + ShortCut = 8226 + end + item + Command = ecPageBottom + ShortCut = 16418 + end + item + Command = ecSelPageBottom + ShortCut = 24610 + end + item + Command = ecPageUp + ShortCut = 33 + end + item + Command = ecSelPageUp + ShortCut = 8225 + end + item + Command = ecPageTop + ShortCut = 16417 + end + item + Command = ecSelPageTop + ShortCut = 24609 + end + item + Command = ecLineStart + ShortCut = 36 + end + item + Command = ecSelLineStart + ShortCut = 8228 + end + item + Command = ecEditorTop + ShortCut = 16420 + end + item + Command = ecSelEditorTop + ShortCut = 24612 + end + item + Command = ecLineEnd + ShortCut = 35 + end + item + Command = ecSelLineEnd + ShortCut = 8227 + end + item + Command = ecEditorBottom + ShortCut = 16419 + end + item + Command = ecSelEditorBottom + ShortCut = 24611 + end + item + Command = ecToggleMode + ShortCut = 45 + end + item + Command = ecCopy + ShortCut = 16429 + end + item + Command = ecPaste + ShortCut = 8237 + end + item + Command = ecDeleteChar + ShortCut = 46 + end + item + Command = ecCut + ShortCut = 8238 + end + item + Command = ecDeleteLastChar + ShortCut = 8 + end + item + Command = ecDeleteLastChar + ShortCut = 8200 + end + item + Command = ecDeleteLastWord + ShortCut = 16392 + end + item + Command = ecUndo + ShortCut = 32776 + end + item + Command = ecRedo + ShortCut = 40968 + end + item + Command = ecLineBreak + ShortCut = 13 + end + item + Command = ecSelectAll + ShortCut = 16449 + end + item + Command = ecCopy + ShortCut = 16451 + end + item + Command = ecBlockIndent + ShortCut = 24649 + end + item + Command = ecLineBreak + ShortCut = 16461 + end + item + Command = ecInsertLine + ShortCut = 16462 + end + item + Command = ecDeleteWord + ShortCut = 16468 + end + item + Command = ecBlockUnindent + ShortCut = 24661 + end + item + Command = ecPaste + ShortCut = 16470 + end + item + Command = ecCut + ShortCut = 16472 + end + item + Command = ecDeleteLine + ShortCut = 16473 + end + item + Command = ecDeleteEOL + ShortCut = 24665 + end + item + Command = ecUndo + ShortCut = 16474 + end + item + Command = ecRedo + ShortCut = 24666 + end + item + Command = ecGotoMarker0 + ShortCut = 16432 + end + item + Command = ecGotoMarker1 + ShortCut = 16433 + end + item + Command = ecGotoMarker2 + ShortCut = 16434 + end + item + Command = ecGotoMarker3 + ShortCut = 16435 + end + item + Command = ecGotoMarker4 + ShortCut = 16436 + end + item + Command = ecGotoMarker5 + ShortCut = 16437 + end + item + Command = ecGotoMarker6 + ShortCut = 16438 + end + item + Command = ecGotoMarker7 + ShortCut = 16439 + end + item + Command = ecGotoMarker8 + ShortCut = 16440 + end + item + Command = ecGotoMarker9 + ShortCut = 16441 + end + item + Command = ecSetMarker0 + ShortCut = 24624 + end + item + Command = ecSetMarker1 + ShortCut = 24625 + end + item + Command = ecSetMarker2 + ShortCut = 24626 + end + item + Command = ecSetMarker3 + ShortCut = 24627 + end + item + Command = ecSetMarker4 + ShortCut = 24628 + end + item + Command = ecSetMarker5 + ShortCut = 24629 + end + item + Command = ecSetMarker6 + ShortCut = 24630 + end + item + Command = ecSetMarker7 + ShortCut = 24631 + end + item + Command = ecSetMarker8 + ShortCut = 24632 + end + item + Command = ecSetMarker9 + ShortCut = 24633 + end + item + Command = EcFoldLevel1 + ShortCut = 41009 + end + item + Command = EcFoldLevel2 + ShortCut = 41010 + end + item + Command = EcFoldLevel1 + ShortCut = 41011 + end + item + Command = EcFoldLevel1 + ShortCut = 41012 + end + item + Command = EcFoldLevel1 + ShortCut = 41013 + end + item + Command = EcFoldLevel6 + ShortCut = 41014 + end + item + Command = EcFoldLevel7 + ShortCut = 41015 + end + item + Command = EcFoldLevel8 + ShortCut = 41016 + end + item + Command = EcFoldLevel9 + ShortCut = 41017 + end + item + Command = EcFoldLevel0 + ShortCut = 41008 + end + item + Command = EcFoldCurrent + ShortCut = 41005 + end + item + Command = EcUnFoldCurrent + ShortCut = 41003 + end + item + Command = EcToggleMarkupWord + ShortCut = 32845 + end + item + Command = ecNormalSelect + ShortCut = 24654 + end + item + Command = ecColumnSelect + ShortCut = 24643 + end + item + Command = ecLineSelect + ShortCut = 24652 + end + item + Command = ecTab + ShortCut = 9 + end + item + Command = ecShiftTab + ShortCut = 8201 + end + item + Command = ecMatchBracket + ShortCut = 24642 + end + item + Command = ecColSelUp + ShortCut = 40998 + end + item + Command = ecColSelDown + ShortCut = 41000 + end + item + Command = ecColSelLeft + ShortCut = 40997 + end + item + Command = ecColSelRight + ShortCut = 40999 + end + item + Command = ecColSelPageDown + ShortCut = 40994 + end + item + Command = ecColSelPageBottom + ShortCut = 57378 + end + item + Command = ecColSelPageUp + ShortCut = 40993 + end + item + Command = ecColSelPageTop + ShortCut = 57377 + end + item + Command = ecColSelLineStart + ShortCut = 40996 + end + item + Command = ecColSelLineEnd + ShortCut = 40995 + end + item + Command = ecColSelEditorTop + ShortCut = 57380 + end + item + Command = ecColSelEditorBottom + ShortCut = 57379 + end> + MouseActions = < + item + Shift = [] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 1 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssShift, ssAlt] + ShiftMask = [ssShift, ssAlt] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 3 + MoveCaret = True + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 12 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccDouble + ClickDir = cdDown + Command = 6 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccTriple + ClickDir = cdDown + Command = 7 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccQuad + ClickDir = cdDown + Command = 8 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbMiddle + ClickCount = ccSingle + ClickDir = cdDown + Command = 10 + MoveCaret = True + Option = 0 + Priority = 0 + end + item + Shift = [ssCtrl] + ShiftMask = [ssShift, ssAlt, ssCtrl] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdUp + Command = 11 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseSelActions = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccSingle + ClickDir = cdDown + Command = 9 + MoveCaret = False + Option = 0 + Priority = 0 + end> + Lines.Strings = ( + 'Debug' + ) + BracketHighlightStyle = sbhsBoth + inline SynLeftGutterPartList1: TSynGutterPartList + object SynGutterMarks1: TSynGutterMarks + Width = 24 + end + object SynGutterLineNumber1: TSynGutterLineNumber + Width = 17 + MouseActions = <> + MarkupInfo.Background = clBtnFace + MarkupInfo.Foreground = clNone + DigitCount = 2 + ShowOnlyLineNumbersMultiplesOf = 1 + ZeroStart = False + LeadingZeros = False + end + object SynGutterChanges1: TSynGutterChanges + Width = 4 + ModifiedColor = 59900 + SavedColor = clGreen + end + object SynGutterSeparator1: TSynGutterSeparator + Width = 2 + end + object SynGutterCodeFolding1: TSynGutterCodeFolding + MouseActions = < + item + Shift = [] + ShiftMask = [] + Button = mbRight + ClickCount = ccSingle + ClickDir = cdUp + Command = 16 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [ssShift] + ShiftMask = [ssShift] + Button = mbMiddle + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 1 + Priority = 0 + end + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 0 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MarkupInfo.Background = clNone + MarkupInfo.Foreground = clGray + MouseActionsExpanded = < + item + Shift = [] + ShiftMask = [] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 14 + MoveCaret = False + Option = 0 + Priority = 0 + end> + MouseActionsCollapsed = < + item + Shift = [ssCtrl] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 0 + Priority = 0 + end + item + Shift = [] + ShiftMask = [ssCtrl] + Button = mbLeft + ClickCount = ccAny + ClickDir = cdDown + Command = 15 + MoveCaret = False + Option = 1 + Priority = 0 + end> + end + end + inline SynRightGutterPartList1: TSynRightGutterPartList + end + end + object btnAdvanced: TButton + Left = 544 + Height = 25 + Top = 5 + Width = 80 + Caption = 'Advanced' + OnClick = btnAdvancedClick + TabOrder = 2 + end + end + object Splitter1: TSplitter + Left = 335 + Height = 224 + Top = 0 + Width = 5 + Align = alRight + ResizeAnchor = akRight + end + object Splitter2: TSplitter + Cursor = crVSplit + Left = 0 + Height = 5 + Top = 224 + Width = 708 + Align = alBottom + ResizeAnchor = akBottom + end + object PasHL: TSynPasSyn + Enabled = False + CommentAttri.Foreground = clGreen + NumberAttri.Foreground = clNavy + StringAttri.Foreground = clPurple + SymbolAttri.Foreground = clMaroon + CaseLabelAttri.Style = [fsItalic] + DirectiveAttri.Foreground = clOlive + CompilerMode = pcmDelphi + NestedComments = False + end +end diff --git a/Projects/lape-wrappers/main.pas b/Projects/lape-wrappers/main.pas new file mode 100644 index 0000000..317582a --- /dev/null +++ b/Projects/lape-wrappers/main.pas @@ -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. + diff --git a/Projects/lape-wrappers/ruwa.ico b/Projects/lape-wrappers/ruwa.ico new file mode 100644 index 0000000..0341321 Binary files /dev/null and b/Projects/lape-wrappers/ruwa.ico differ diff --git a/Projects/lape-wrappers/ruwa.lpi b/Projects/lape-wrappers/ruwa.lpi new file mode 100644 index 0000000..b30a17f --- /dev/null +++ b/Projects/lape-wrappers/ruwa.lpi @@ -0,0 +1,380 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/lape-wrappers/ruwa.lpr b/Projects/lape-wrappers/ruwa.lpr new file mode 100644 index 0000000..049bd79 --- /dev/null +++ b/Projects/lape-wrappers/ruwa.lpr @@ -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. + diff --git a/Projects/lape-wrappers/wrapfiles.lfm b/Projects/lape-wrappers/wrapfiles.lfm new file mode 100644 index 0000000..9762268 --- /dev/null +++ b/Projects/lape-wrappers/wrapfiles.lfm @@ -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 diff --git a/Projects/lape-wrappers/wrapfiles.pas b/Projects/lape-wrappers/wrapfiles.pas new file mode 100644 index 0000000..59d8553 --- /dev/null +++ b/Projects/lape-wrappers/wrapfiles.pas @@ -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. + diff --git a/Units/MMLAddon/LPInc/Wrappers/GENERATE THESE! b/Units/MMLAddon/LPInc/Wrappers/GENERATE THESE! new file mode 100644 index 0000000..e69de29 diff --git a/Units/MMLAddon/LPInc/Wrappers/bitmap.inc b/Units/MMLAddon/LPInc/Wrappers/bitmap.inc new file mode 100644 index 0000000..717b71b --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/bitmap.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/colour.inc b/Units/MMLAddon/LPInc/Wrappers/colour.inc new file mode 100644 index 0000000..db8d257 --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/colour.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/colourconv.inc b/Units/MMLAddon/LPInc/Wrappers/colourconv.inc new file mode 100644 index 0000000..07910d9 --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/colourconv.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/crypto.inc b/Units/MMLAddon/LPInc/Wrappers/crypto.inc new file mode 100644 index 0000000..63e2a8b --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/crypto.inc @@ -0,0 +1,4 @@ +procedure Lape_haval(const Params: PParamArray; const Result: Pointer); +begin + Pstring(Result)^ := ps_haval(Pstring(Params^[0])^); +end; diff --git a/Units/MMLAddon/LPInc/Wrappers/dtm.inc b/Units/MMLAddon/LPInc/Wrappers/dtm.inc new file mode 100644 index 0000000..d65b0af --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/dtm.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/extensions.inc b/Units/MMLAddon/LPInc/Wrappers/extensions.inc new file mode 100644 index 0000000..68d3628 --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/extensions.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/file.inc b/Units/MMLAddon/LPInc/Wrappers/file.inc new file mode 100644 index 0000000..2fd6685 --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/file.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/internets.inc b/Units/MMLAddon/LPInc/Wrappers/internets.inc new file mode 100644 index 0000000..e4651c3 --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/internets.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/keyboard.inc b/Units/MMLAddon/LPInc/Wrappers/keyboard.inc new file mode 100644 index 0000000..9ff164e --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/keyboard.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/math.inc b/Units/MMLAddon/LPInc/Wrappers/math.inc new file mode 100644 index 0000000..cba1832 --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/math.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/mouse.inc b/Units/MMLAddon/LPInc/Wrappers/mouse.inc new file mode 100644 index 0000000..951a34b --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/mouse.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/ocr.inc b/Units/MMLAddon/LPInc/Wrappers/ocr.inc new file mode 100644 index 0000000..c1bf07e --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/ocr.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/other.inc b/Units/MMLAddon/LPInc/Wrappers/other.inc new file mode 100644 index 0000000..4a7969c --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/other.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/settings.inc b/Units/MMLAddon/LPInc/Wrappers/settings.inc new file mode 100644 index 0000000..f865eb6 --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/settings.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/strings.inc b/Units/MMLAddon/LPInc/Wrappers/strings.inc new file mode 100644 index 0000000..155830c --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/strings.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/tpa.inc b/Units/MMLAddon/LPInc/Wrappers/tpa.inc new file mode 100644 index 0000000..32a5535 --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/tpa.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/Wrappers/window.inc b/Units/MMLAddon/LPInc/Wrappers/window.inc new file mode 100644 index 0000000..7d70e4b --- /dev/null +++ b/Units/MMLAddon/LPInc/Wrappers/window.inc @@ -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; diff --git a/Units/MMLAddon/LPInc/lpcompile.inc b/Units/MMLAddon/LPInc/lpcompile.inc new file mode 100644 index 0000000..a67c950 --- /dev/null +++ b/Units/MMLAddon/LPInc/lpcompile.inc @@ -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 . + + 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'); + diff --git a/Units/MMLAddon/LPInc/lpdefines.inc b/Units/MMLAddon/LPInc/lpdefines.inc new file mode 100644 index 0000000..67b5f24 --- /dev/null +++ b/Units/MMLAddon/LPInc/lpdefines.inc @@ -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 . + + 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 } \ No newline at end of file diff --git a/Units/MMLAddon/LPInc/lpexportedmethods.inc b/Units/MMLAddon/LPInc/lpexportedmethods.inc new file mode 100644 index 0000000..6c57193 --- /dev/null +++ b/Units/MMLAddon/LPInc/lpexportedmethods.inc @@ -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 . + + 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... diff --git a/Units/MMLAddon/LPInc/lpexportedmethodsinc.inc b/Units/MMLAddon/LPInc/lpexportedmethodsinc.inc new file mode 100644 index 0000000..fe38e06 --- /dev/null +++ b/Units/MMLAddon/LPInc/lpexportedmethodsinc.inc @@ -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); diff --git a/Units/MMLAddon/mmlpsthread.pas b/Units/MMLAddon/mmlpsthread.pas index 6f194f7..9d43942 100644 --- a/Units/MMLAddon/mmlpsthread.pas +++ b/Units/MMLAddon/mmlpsthread.pas @@ -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; diff --git a/Units/lape b/Units/lape index b24c52b..91f6956 160000 --- a/Units/lape +++ b/Units/lape @@ -1 +1 @@ -Subproject commit b24c52b9748c6f9f3e91a7a86f727022bf2fd6ce +Subproject commit 91f6956ba801992efc5894e77888b84a987edadd