diff --git a/branches/script-component/Projects/OCRBench/project1.lpi b/branches/script-component/Projects/OCRBench/project1.lpi index ecec126..2d9400f 100644 --- a/branches/script-component/Projects/OCRBench/project1.lpi +++ b/branches/script-component/Projects/OCRBench/project1.lpi @@ -7,7 +7,7 @@ - + @@ -31,12 +31,12 @@ - + - + @@ -44,10 +44,10 @@ - - + + - + @@ -73,10 +73,10 @@ - - - - + + + + @@ -84,8 +84,8 @@ - - + + @@ -93,8 +93,8 @@ - - + + @@ -102,8 +102,8 @@ - - + + @@ -117,17 +117,15 @@ - - - - + + @@ -135,8 +133,8 @@ - - + + @@ -156,24 +154,26 @@ - - + + - - - + + + + + - - - - + + + + @@ -181,150 +181,175 @@ - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/branches/script-component/Projects/OCRBench/unit1.pas b/branches/script-component/Projects/OCRBench/unit1.pas index e0cb9ae..94e2a9d 100644 --- a/branches/script-component/Projects/OCRBench/unit1.pas +++ b/branches/script-component/Projects/OCRBench/unit1.pas @@ -6,7 +6,9 @@ interface uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, - StdCtrls, ExtCtrls, Client, MufasaTypes, Bitmaps, ocr, windowselector,window; + StdCtrls, ExtCtrls, Client, MufasaTypes, Bitmaps, ocr, windowselector, + {$IFDEF MSWINDOWS} os_windows, {$ENDIF} + {$IFDEF LINUX} os_linux {$ENDIF}; type @@ -31,7 +33,7 @@ type BitmapPath: String; FontPath: String; - CliW: TMWindow; + CliW: TIOManager; UseClient: Boolean; { private declarations } public @@ -79,14 +81,14 @@ begin Form1.Image1.Canvas.Rectangle(0, 0, Form1.Image1.Canvas.Width, Form1.Image1.Canvas.Height); // create and init client - C := TClient.Create; + C := TClient.Create(''); bmp := TMufasaBitmap.Create; if UseClient then - C.MWindow.SetWindow(CliW) + C.IOManager.SetTarget(TWindow(CliW.GetImageTarget).GetNativeWindow()) else begin bmp.LoadFromFile(BitmapPath); - C.MWindow.SetTarget(bmp); + C.IOManager.SetTarget(bmp); end; Shadow :=FShadow.Checked; @@ -158,7 +160,7 @@ Var begin UseClient := True; if not assigned(CliW) then - CliW := TMWindow.Create; + CliW := TIOManager.Create; WS := TMWindowSelector.Create(CliW); CliW.SetTarget(WS.Drag{$IFDEF WINDOWS},w_Window{$ENDIF}); end; diff --git a/branches/script-component/Projects/SAMufasaGUI/project1.ico b/branches/script-component/Projects/SAMufasaGUI/project1.ico new file mode 100644 index 0000000..e350cac Binary files /dev/null and b/branches/script-component/Projects/SAMufasaGUI/project1.ico differ diff --git a/branches/script-component/Projects/SAMufasaGUI/project1.lpi b/branches/script-component/Projects/SAMufasaGUI/project1.lpi index 3b30106..89413a5 100644 --- a/branches/script-component/Projects/SAMufasaGUI/project1.lpi +++ b/branches/script-component/Projects/SAMufasaGUI/project1.lpi @@ -10,12 +10,13 @@ <UseXPManifest Value="True"/> - <ActiveEditorIndexAtStart Value="0"/> + <Icon Value="0"/> + <ActiveEditorIndexAtStart Value="10"/> </General> <VersionInfo> <ProjectVersion Value=""/> - <Language Value="0403"/> - <CharSet Value="04E2"/> + <Language Value="0421"/> + <CharSet Value="03A4"/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -139,11 +140,9 @@ <HasResources Value="True"/> <ResourceBaseClass Value="Form"/> <UnitName Value="TestUnit"/> - <CursorPos X="1" Y="557"/> - <TopLine Value="540"/> - <EditorIndex Value="10"/> + <CursorPos X="3" Y="1550"/> + <TopLine Value="1548"/> <UsageCount Value="202"/> - <Loaded Value="True"/> </Unit13> <Unit14> <Filename Value="../Compilertje/Units/CogatUnits/compinput.pas"/> @@ -191,7 +190,7 @@ <UnitName Value="Client"/> <CursorPos X="15" Y="67"/> <TopLine Value="49"/> - <EditorIndex Value="3"/> + <EditorIndex Value="7"/> <UsageCount Value="201"/> <Loaded Value="True"/> </Unit20> @@ -266,9 +265,9 @@ <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="mmlpsthread"/> - <CursorPos X="1" Y="465"/> - <TopLine Value="492"/> - <EditorIndex Value="6"/> + <CursorPos X="31" Y="260"/> + <TopLine Value="243"/> + <EditorIndex Value="10"/> <UsageCount Value="202"/> <Loaded Value="True"/> </Unit30> @@ -350,7 +349,7 @@ <UnitName Value="bitmaps"/> <CursorPos X="12" Y="93"/> <TopLine Value="83"/> - <EditorIndex Value="13"/> + <EditorIndex Value="11"/> <UsageCount Value="200"/> <Loaded Value="True"/> </Unit42> @@ -495,11 +494,9 @@ </Unit63> <Unit64> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/other.inc"/> - <CursorPos X="23" Y="107"/> - <TopLine Value="7"/> - <EditorIndex Value="11"/> - <UsageCount Value="45"/> - <Loaded Value="True"/> + <CursorPos X="1" Y="1"/> + <TopLine Value="90"/> + <UsageCount Value="44"/> </Unit64> <Unit65> <Filename Value="../../Units/PascalScript/uPSCompiler.pas"/> @@ -538,10 +535,8 @@ <IsPartOfProject Value="True"/> <UnitName Value="plugins"/> <CursorPos X="34" Y="70"/> - <TopLine Value="71"/> - <EditorIndex Value="7"/> + <TopLine Value="49"/> <UsageCount Value="200"/> - <Loaded Value="True"/> </Unit70> <Unit71> <Filename Value="../../Units/MMLAddon/PSInc/psdefines.inc"/> @@ -627,10 +622,8 @@ <IsPartOfProject Value="True"/> <UnitName Value="windowselector"/> <CursorPos X="37" Y="34"/> - <TopLine Value="176"/> - <EditorIndex Value="9"/> + <TopLine Value="12"/> <UsageCount Value="201"/> - <Loaded Value="True"/> </Unit82> <Unit83> <Filename Value="../../../usr/lib64/fpc/2.2.4/source/rtl/objpas/classes/classesh.inc"/> @@ -713,9 +706,11 @@ <Filename Value="../../Units/MMLCore/ocr.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="ocr"/> - <CursorPos X="50" Y="739"/> + <CursorPos X="82" Y="720"/> <TopLine Value="720"/> + <EditorIndex Value="1"/> <UsageCount Value="200"/> + <Loaded Value="True"/> </Unit94> <Unit95> <Filename Value="../../Units/PascalScript/uPSR_extctrls.pas"/> @@ -770,9 +765,9 @@ <Unit103> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/window.inc"/> <CursorPos X="12" Y="63"/> - <TopLine Value="29"/> - <EditorIndex Value="1"/> - <UsageCount Value="20"/> + <TopLine Value="30"/> + <EditorIndex Value="5"/> + <UsageCount Value="16"/> <Loaded Value="True"/> </Unit103> <Unit104> @@ -892,11 +887,9 @@ <ComponentName Value="ScriptFrame"/> <ResourceBaseClass Value="Frame"/> <UnitName Value="framescript"/> - <CursorPos X="23" Y="72"/> - <TopLine Value="223"/> - <EditorIndex Value="8"/> + <CursorPos X="1" Y="101"/> + <TopLine Value="98"/> <UsageCount Value="200"/> - <Loaded Value="True"/> </Unit120> <Unit121> <Filename Value="../../../lazarus/lcl/include/pagecontrol.inc"/> @@ -1546,7 +1539,9 @@ <UnitName Value="ocrutil"/> <CursorPos X="52" Y="609"/> <TopLine Value="585"/> + <EditorIndex Value="3"/> <UsageCount Value="37"/> + <Loaded Value="True"/> </Unit216> <Unit217> <Filename Value="../../../Documents/fpc/rtl/objpas/sysutils/filutilh.inc"/> @@ -1595,7 +1590,7 @@ <UnitName Value="framefunctionlist"/> <CursorPos X="26" Y="295"/> <TopLine Value="7"/> - <UsageCount Value="189"/> + <UsageCount Value="182"/> </Unit223> <Unit224> <Filename Value="../../../usr/local/share/lazarus/lcl/comctrls.pp"/> @@ -1622,7 +1617,9 @@ <UnitName Value="fontloader"/> <CursorPos X="59" Y="173"/> <TopLine Value="151"/> + <EditorIndex Value="4"/> <UsageCount Value="12"/> + <Loaded Value="True"/> </Unit227> <Unit228> <Filename Value="../../Units/MMLCore/mufasatypesutil.pas"/> @@ -1650,7 +1647,7 @@ <UnitName Value="simpleanalyzer"/> <CursorPos X="52" Y="104"/> <TopLine Value="193"/> - <UsageCount Value="176"/> + <UsageCount Value="169"/> </Unit231> <Unit232> <Filename Value="../../Units/Misc/mPasLex.pas"/> @@ -1708,10 +1705,10 @@ </Unit239> <Unit240> <Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/> - <CursorPos X="89" Y="99"/> - <TopLine Value="78"/> - <EditorIndex Value="2"/> - <UsageCount Value="31"/> + <CursorPos X="40" Y="59"/> + <TopLine Value="36"/> + <EditorIndex Value="6"/> + <UsageCount Value="27"/> <Loaded Value="True"/> </Unit240> <Unit241> @@ -1727,7 +1724,7 @@ <UnitName Value="updater"/> <CursorPos X="38" Y="211"/> <TopLine Value="65"/> - <UsageCount Value="149"/> + <UsageCount Value="142"/> </Unit242> <Unit243> <Filename Value="updateform.pas"/> @@ -1738,7 +1735,7 @@ <ComponentState Value="1"/> <CursorPos X="111" Y="102"/> <TopLine Value="207"/> - <UsageCount Value="144"/> + <UsageCount Value="137"/> </Unit243> <Unit244> <Filename Value="../../../Documents/lazarus/lcl/fileutil.pas"/> @@ -1859,7 +1856,7 @@ <UnitName Value="simbasettings"/> <CursorPos X="26" Y="9"/> <TopLine Value="11"/> - <UsageCount Value="107"/> + <UsageCount Value="100"/> </Unit261> <Unit262> <Filename Value="../../Units/MMLAddon/settings.pas"/> @@ -1897,7 +1894,7 @@ <UnitName Value="reportbug"/> <CursorPos X="53" Y="23"/> <TopLine Value="21"/> - <UsageCount Value="90"/> + <UsageCount Value="83"/> </Unit266> <Unit267> <Filename Value="../../Units/Synapse/synsock.pas"/> @@ -1954,7 +1951,7 @@ <UnitName Value="newinternets"/> <CursorPos X="37" Y="171"/> <TopLine Value="153"/> - <UsageCount Value="86"/> + <UsageCount Value="79"/> </Unit274> <Unit275> <Filename Value="reportbug.lrs"/> @@ -2000,19 +1997,19 @@ <Unit281> <Filename Value="../../Units/MMLCore/iomanager.pas"/> <UnitName Value="IOManager"/> - <CursorPos X="24" Y="617"/> - <TopLine Value="605"/> + <CursorPos X="67" Y="53"/> + <TopLine Value="34"/> <EditorIndex Value="0"/> - <UsageCount Value="34"/> + <UsageCount Value="30"/> <Loaded Value="True"/> </Unit281> <Unit282> <Filename Value="../../Units/MMLCore/os_linux.pas"/> <UnitName Value="os_linux"/> <CursorPos X="36" Y="69"/> - <TopLine Value="34"/> - <EditorIndex Value="5"/> - <UsageCount Value="33"/> + <TopLine Value="56"/> + <EditorIndex Value="9"/> + <UsageCount Value="29"/> <Loaded Value="True"/> </Unit282> <Unit283> @@ -2025,10 +2022,10 @@ <Unit284> <Filename Value="../../Units/MMLCore/os_windows.pas"/> <UnitName Value="os_windows"/> - <CursorPos X="9" Y="75"/> - <TopLine Value="67"/> - <EditorIndex Value="14"/> - <UsageCount Value="29"/> + <CursorPos X="22" Y="164"/> + <TopLine Value="155"/> + <EditorIndex Value="12"/> + <UsageCount Value="25"/> <Loaded Value="True"/> </Unit284> <Unit285> @@ -2049,11 +2046,9 @@ <Filename Value="../../Units/MMLCore/libloader.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="libloader"/> - <CursorPos X="11" Y="141"/> - <TopLine Value="116"/> - <EditorIndex Value="12"/> - <UsageCount Value="44"/> - <Loaded Value="True"/> + <CursorPos X="1" Y="149"/> + <TopLine Value="128"/> + <UsageCount Value="37"/> </Unit287> <Unit288> <Filename Value="../../Units/MMLAddon/tpa.pas"/> @@ -2064,10 +2059,10 @@ </Unit288> <Unit289> <Filename Value="../../Units/PascalScript/x86.inc"/> - <CursorPos X="1" Y="162"/> - <TopLine Value="145"/> - <EditorIndex Value="4"/> - <UsageCount Value="19"/> + <CursorPos X="8" Y="157"/> + <TopLine Value="140"/> + <EditorIndex Value="8"/> + <UsageCount Value="15"/> <Loaded Value="True"/> </Unit289> <Unit290> @@ -2088,130 +2083,128 @@ <UnitName Value="tpa"/> <CursorPos X="70" Y="1393"/> <TopLine Value="1364"/> + <EditorIndex Value="2"/> <UsageCount Value="12"/> + <Loaded Value="True"/> </Unit292> </Units> - <JumpHistory Count="30" HistoryIndex="29"> + <JumpHistory Count="29" HistoryIndex="28"> <Position1> - <Filename Value="framescript.pas"/> - <Caret Line="73" Column="41" TopLine="54"/> + <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/window.inc"/> + <Caret Line="1" Column="1" TopLine="1"/> </Position1> <Position2> - <Filename Value="testunit.pas"/> - <Caret Line="1550" Column="3" TopLine="1548"/> + <Filename Value="../../Units/PascalScript/x86.inc"/> + <Caret Line="592" Column="60" TopLine="584"/> </Position2> <Position3> - <Filename Value="testunit.pas"/> - <Caret Line="541" Column="21" TopLine="518"/> + <Filename Value="../../Units/MMLCore/client.pas"/> + <Caret Line="36" Column="17" TopLine="27"/> </Position3> <Position4> - <Filename Value="testunit.pas"/> - <Caret Line="536" Column="30" TopLine="519"/> + <Filename Value="../../Units/MMLCore/os_linux.pas"/> + <Caret Line="48" Column="50" TopLine="34"/> </Position4> <Position5> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> - <Caret Line="97" Column="54" TopLine="73"/> + <Caret Line="345" Column="27" TopLine="311"/> </Position5> <Position6> - <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> - <Caret Line="240" Column="69" TopLine="223"/> + <Filename Value="../../Units/MMLCore/os_linux.pas"/> + <Caret Line="69" Column="36" TopLine="56"/> </Position6> <Position7> - <Filename Value="testunit.pas"/> - <Caret Line="550" Column="46" TopLine="532"/> + <Filename Value="../../Units/MMLCore/iomanager.pas"/> + <Caret Line="201" Column="29" TopLine="195"/> </Position7> <Position8> - <Filename Value="testunit.pas"/> - <Caret Line="636" Column="33" TopLine="613"/> + <Filename Value="../../Units/MMLCore/iomanager.pas"/> + <Caret Line="372" Column="45" TopLine="348"/> </Position8> <Position9> - <Filename Value="testunit.pas"/> - <Caret Line="1439" Column="24" TopLine="1422"/> + <Filename Value="../../Units/MMLCore/iomanager.pas"/> + <Caret Line="202" Column="29" TopLine="177"/> </Position9> <Position10> - <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> - <Caret Line="46" Column="30" TopLine="32"/> + <Filename Value="../../Units/MMLCore/iomanager.pas"/> + <Caret Line="346" Column="59" TopLine="328"/> </Position10> <Position11> - <Filename Value="testunit.pas"/> - <Caret Line="1718" Column="79" TopLine="1699"/> + <Filename Value="../../Units/MMLCore/ocr.pas"/> + <Caret Line="47" Column="34" TopLine="34"/> </Position11> <Position12> - <Filename Value="testunit.pas"/> - <Caret Line="1711" Column="38" TopLine="1696"/> + <Filename Value="../../Units/MMLCore/tpa.pas"/> + <Caret Line="76" Column="21" TopLine="58"/> </Position12> <Position13> - <Filename Value="../../Units/MMLCore/libloader.pas"/> - <Caret Line="38" Column="31" TopLine="17"/> + <Filename Value="../../Units/MMLCore/tpa.pas"/> + <Caret Line="77" Column="21" TopLine="58"/> </Position13> <Position14> - <Filename Value="../../Units/MMLCore/iomanager.pas"/> - <Caret Line="600" Column="15" TopLine="564"/> + <Filename Value="../../Units/MMLCore/ocr.pas"/> + <Caret Line="31" Column="54" TopLine="23"/> </Position14> <Position15> - <Filename Value="testunit.pas"/> - <Caret Line="1718" Column="10" TopLine="1702"/> + <Filename Value="../../Units/MMLCore/ocrutil.pas"/> + <Caret Line="85" Column="37" TopLine="69"/> </Position15> <Position16> - <Filename Value="../../Units/MMLCore/libloader.pas"/> - <Caret Line="45" Column="1" TopLine="28"/> + <Filename Value="../../Units/MMLCore/ocrutil.pas"/> + <Caret Line="25" Column="12" TopLine="12"/> </Position16> <Position17> - <Filename Value="../../Units/MMLCore/libloader.pas"/> - <Caret Line="46" Column="1" TopLine="29"/> + <Filename Value="../../Units/MMLCore/ocrutil.pas"/> + <Caret Line="26" Column="12" TopLine="12"/> </Position17> <Position18> - <Filename Value="../../Units/MMLCore/libloader.pas"/> - <Caret Line="48" Column="1" TopLine="31"/> + <Filename Value="../../Units/MMLCore/ocrutil.pas"/> + <Caret Line="20" Column="13" TopLine="12"/> </Position18> <Position19> - <Filename Value="../../Units/MMLCore/iomanager.pas"/> - <Caret Line="254" Column="1" TopLine="237"/> + <Filename Value="../../Units/MMLCore/ocr.pas"/> + <Caret Line="656" Column="23" TopLine="625"/> </Position19> <Position20> - <Filename Value="../../Units/MMLCore/libloader.pas"/> - <Caret Line="45" Column="1" TopLine="28"/> + <Filename Value="../../Units/MMLCore/fontloader.pas"/> + <Caret Line="63" Column="34" TopLine="37"/> </Position20> <Position21> - <Filename Value="../../Units/MMLCore/libloader.pas"/> - <Caret Line="46" Column="1" TopLine="29"/> + <Filename Value="../../Units/MMLCore/ocr.pas"/> + <Caret Line="710" Column="61" TopLine="692"/> </Position21> <Position22> - <Filename Value="../../Units/MMLCore/libloader.pas"/> - <Caret Line="48" Column="1" TopLine="31"/> + <Filename Value="../../Units/MMLCore/ocr.pas"/> + <Caret Line="55" Column="42" TopLine="37"/> </Position22> <Position23> - <Filename Value="testunit.pas"/> - <Caret Line="557" Column="1" TopLine="540"/> + <Filename Value="../../Units/MMLCore/ocr.pas"/> + <Caret Line="714" Column="22" TopLine="692"/> </Position23> <Position24> - <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> - <Caret Line="462" Column="32" TopLine="445"/> + <Filename Value="../../Units/MMLCore/fontloader.pas"/> + <Caret Line="55" Column="29" TopLine="37"/> </Position24> <Position25> - <Filename Value="../../Units/MMLCore/libloader.pas"/> - <Caret Line="45" Column="1" TopLine="28"/> + <Filename Value="../../Units/MMLCore/fontloader.pas"/> + <Caret Line="79" Column="10" TopLine="61"/> </Position25> <Position26> - <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> - <Caret Line="461" Column="69" TopLine="455"/> + <Filename Value="../../Units/MMLCore/ocr.pas"/> + <Caret Line="729" Column="26" TopLine="702"/> </Position26> <Position27> - <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> - <Caret Line="464" Column="1" TopLine="447"/> + <Filename Value="../../Units/MMLCore/ocr.pas"/> + <Caret Line="712" Column="8" TopLine="703"/> </Position27> <Position28> - <Filename Value="../../Units/MMLCore/libloader.pas"/> - <Caret Line="134" Column="45" TopLine="116"/> + <Filename Value="../../Units/MMLCore/ocr.pas"/> + <Caret Line="721" Column="23" TopLine="703"/> </Position28> <Position29> - <Filename Value="../../Units/MMLCore/libloader.pas"/> - <Caret Line="133" Column="83" TopLine="116"/> + <Filename Value="../../Units/MMLCore/ocr.pas"/> + <Caret Line="751" Column="10" TopLine="720"/> </Position29> - <Position30> - <Filename Value="../../Units/MMLCore/libloader.pas"/> - <Caret Line="141" Column="11" TopLine="116"/> - </Position30> </JumpHistory> </ProjectOptions> <CompilerOptions> @@ -2230,6 +2223,12 @@ <OptimizationLevel Value="2"/> </Optimizations> </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="True"/> + <GenerateDwarf Value="True"/> + </Debugging> + </Linking> <Other> <CustomOptions Value="-dUseCThreads -dM_MEMORY_DEBUG @@ -2239,6 +2238,12 @@ </Other> </CompilerOptions> <Debugging> + <BreakPoints Count="1"> + <Item1> + <Source Value="../../Units/MMLCore/libloader.pas"/> + <Line Value="60"/> + </Item1> + </BreakPoints> <Exceptions Count="3"> <Item1> <Name Value="EAbort"/> diff --git a/branches/script-component/Projects/SAMufasaGUI/project1.lpr b/branches/script-component/Projects/SAMufasaGUI/project1.lpr index 0db1af9..d925af1 100644 --- a/branches/script-component/Projects/SAMufasaGUI/project1.lpr +++ b/branches/script-component/Projects/SAMufasaGUI/project1.lpr @@ -35,6 +35,8 @@ libloader; //{$R project1.res} +{$R project1.res} + begin Application.Title:='Simba'; Application.Initialize; diff --git a/branches/script-component/Projects/SAMufasaGUI/project1.res b/branches/script-component/Projects/SAMufasaGUI/project1.res new file mode 100644 index 0000000..da688d6 Binary files /dev/null and b/branches/script-component/Projects/SAMufasaGUI/project1.res differ diff --git a/branches/script-component/Projects/SAMufasaGUI/testunit.pas b/branches/script-component/Projects/SAMufasaGUI/testunit.pas index ece40ea..9883219 100644 --- a/branches/script-component/Projects/SAMufasaGUI/testunit.pas +++ b/branches/script-component/Projects/SAMufasaGUI/testunit.pas @@ -43,7 +43,7 @@ uses ColorBox , about, framefunctionlist, ocr, updateform, simbasettings; const - SimbaVersion = 462; + SimbaVersion = 469; type diff --git a/branches/script-component/Units/MMLCore/iomanager.pas b/branches/script-component/Units/MMLCore/iomanager.pas index 29405e9..4ae2e9b 100644 --- a/branches/script-component/Units/MMLCore/iomanager.pas +++ b/branches/script-component/Units/MMLCore/iomanager.pas @@ -222,7 +222,9 @@ interface procedure PressKey(key: Word); procedure SendText(text: string); function isKeyDown(key: Word): Boolean; - + + function GetImageTarget: TTarget; + protected keymouse: TTarget; image: TTarget; @@ -231,6 +233,7 @@ interface bothsame: boolean; procedure SetImageTarget(target: TTarget); + procedure SetKeyMouseTarget(target: TTarget); procedure SetBothTargets(target: TTarget); procedure NativeInit; virtual; abstract; @@ -290,6 +293,12 @@ begin image:= target; bothsame:= false; end; + +function TIOManager_Abstract.GetImageTarget: TTarget; +begin + result := image; +end; + procedure TIOManager_Abstract.SetKeyMouseTarget(target: TTarget); begin if not(bothsame) then keymouse.Free(); @@ -340,17 +349,34 @@ begin result:= frozen <> nil; end; -function TIOManager_Abstract.GetColor(x,y : integer) : TColor; begin result:= image.GetColor(x,y); end; -function TIOManager_Abstract.ReturnData(xs,ys,width,height: integer): TRetData; begin result:= image.ReturnData(xs,ys,width,height); end; -procedure TIOManager_Abstract.FreeReturnData; begin image.freeReturnData(); end; +function TIOManager_Abstract.GetColor(x,y : integer) : TColor; +begin + result:= image.GetColor(x,y); +end; +function TIOManager_Abstract.ReturnData(xs,ys,width,height: integer): TRetData; +begin + result:= image.ReturnData(xs,ys,width,height); +end; +procedure TIOManager_Abstract.FreeReturnData; +begin + image.freeReturnData(); +end; + +function TIOManager_Abstract.SetTarget(ArrPtr: PRGB32; Size: TPoint): integer; +begin + SetImageTarget(TRawTarget.Create(ArrPtr,Size.X,Size.Y)); +end; +function TIOManager_Abstract.SetTarget(bmp : TMufasaBitmap) : integer; +begin + SetImageTarget(TRawTarget.Create(bmp.FData,bmp.width,bmp.height)); +end; -function TIOManager_Abstract.SetTarget(ArrPtr: PRGB32; Size: TPoint): integer; begin SetImageTarget(TRawTarget.Create(ArrPtr,Size.X,Size.Y)); end; -function TIOManager_Abstract.SetTarget(bmp : TMufasaBitmap) : integer; begin SetImageTarget(TRawTarget.Create(bmp.FData,bmp.width,bmp.height)); end; function TIOManager_Abstract.SetTarget(name: string; initargs: pointer): integer; var client: TEIOS_Client; begin - if not eios_controller.ClientExists(name) then raise Exception.Create('EIOS Client by specified name does not exist'); + if not eios_controller.ClientExists(name) then + raise Exception.Create('EIOS Client by specified name does not exist'); client:= eios_controller.GetClient(name); SetBothTargets(TEIOS_Target.Create(client, initargs)); end; @@ -369,10 +395,23 @@ begin {not sure if image needs activation or not, if its a native window keymouse == image so it should be good.} end; -procedure TIOManager_Abstract.GetMousePos(var X, Y: Integer); begin keymouse.GetMousePosition(x,y) end; -procedure TIOManager_Abstract.SetMousePos(X, Y: Integer); begin keymouse.MoveMouse(x,y); end; -procedure TIOManager_Abstract.HoldMouse(x,y : integer; button: TClickType); begin keymouse.ReleaseMouse(x,y,button); end; -procedure TIOManager_Abstract.ReleaseMouse(x,y : integer; button: TClickType); begin keymouse.ReleaseMouse(x,y,button); end; +procedure TIOManager_Abstract.GetMousePos(var X, Y: Integer); +begin + keymouse.GetMousePosition(x,y) +end; +procedure TIOManager_Abstract.SetMousePos(X, Y: Integer); +begin + keymouse.MoveMouse(x,y); +end; +procedure TIOManager_Abstract.HoldMouse(x,y : integer; button: TClickType); +begin + keymouse.HoldMouse(x,y,button); +end; +procedure TIOManager_Abstract.ReleaseMouse(x,y : integer; button: TClickType); +begin + keymouse.ReleaseMouse(x,y,button); +end; + procedure TIOManager_Abstract.ClickMouse(X, Y: Integer; button: TClickType); begin HoldMouse(x,y,button); @@ -380,11 +419,28 @@ begin ReleaseMouse(x,y,button); end; -procedure TIOManager_Abstract.KeyUp(key: Word); begin keymouse.ReleaseKey(key) end; -procedure TIOManager_Abstract.KeyDown(key: Word); begin keymouse.HoldKey(key) end; -procedure TIOManager_Abstract.PressKey(key: Word); begin keyup(key); keydown(key); end; -procedure TIOManager_Abstract.SendText(text: string); begin keymouse.SendString(text); end; -function TIOManager_Abstract.isKeyDown(key: Word): Boolean; begin result:= keymouse.IsKeyHeld(key); end; +procedure TIOManager_Abstract.KeyUp(key: Word); +begin + keymouse.ReleaseKey(key) +end; +procedure TIOManager_Abstract.KeyDown(key: Word); +begin + keymouse.HoldKey(key) +end; +procedure TIOManager_Abstract.PressKey(key: Word); +begin + keyup(key); + keydown(key); +end; +procedure TIOManager_Abstract.SendText(text: string); +begin + keymouse.SendString(text); +end; + +function TIOManager_Abstract.isKeyDown(key: Word): Boolean; +begin + result:= keymouse.IsKeyHeld(key); +end; //***implementation*** TTarget diff --git a/branches/script-component/Units/MMLCore/ocr.pas b/branches/script-component/Units/MMLCore/ocr.pas index 661a5a5..b665f6c 100644 --- a/branches/script-component/Units/MMLCore/ocr.pas +++ b/branches/script-component/Units/MMLCore/ocr.pas @@ -54,7 +54,7 @@ uses procedure FilterShadowBitmap(bmp: TMufasaBitmap); procedure FilterCharsBitmap(bmp: TMufasaBitmap); - function GetTextAt(atX, atY, font, minspacing, maxspacing, color, len: integer): string; + function GetTextAt(atX, atY, minspacing, maxspacing, color, tol, len: integer; font: string): string; function TextToFontTPA(Text, font: String; var w, h: integer): TPointArray; function TextToFontBitmap(Text, font: String): TMufasaBitmap; function TextToMask(Text, font: String): TMask; @@ -704,9 +704,17 @@ begin result := GetUpTextAtEx(atX, atY, false); end; -function TMOCR.GetTextAt(atX, atY, font, minspacing, maxspacing, color, len: integer): string; +function TMOCR.GetTextAt(atX, atY, minspacing, maxspacing, color, tol, len: integer; font: string): string; + +var + fD: TocrData; + TPA: TPointArray; begin + fD := Fonts.GetFont(font); + SetLength(TPA, 0); + TClient(Client).MFinder.FindColorsTolerance(TPA, color, atX, atY, {fuck}0, {fuck}0, tol); + end; diff --git a/branches/script-component/Units/MMLCore/os_linux.pas b/branches/script-component/Units/MMLCore/os_linux.pas index 19c23f0..7bb6c32 100644 --- a/branches/script-component/Units/MMLCore/os_linux.pas +++ b/branches/script-component/Units/MMLCore/os_linux.pas @@ -57,6 +57,8 @@ interface procedure HoldKey(key: integer); override; procedure ReleaseKey(key: integer); override; function IsKeyHeld(key: integer): boolean; override; + + function GetNativeWindow: x.TWindow; private display: PDisplay; screennum: integer; @@ -131,7 +133,12 @@ implementation keyinput.Free; inherited Destroy; end; - + + function TWindow.GetNativeWindow: x.TWindow; + begin + result := self.window; + end; + procedure TWindow.GetTargetDimensions(var w, h: integer); var Old_Handler: TXErrorHandler; diff --git a/branches/script-component/Units/MMLCore/os_windows.pas b/branches/script-component/Units/MMLCore/os_windows.pas index 79e4d17..91648c1 100644 --- a/branches/script-component/Units/MMLCore/os_windows.pas +++ b/branches/script-component/Units/MMLCore/os_windows.pas @@ -58,6 +58,8 @@ interface procedure HoldKey(key: integer); override; procedure ReleaseKey(key: integer); override; function IsKeyHeld(key: integer): boolean; override; + + function GetNativeWindow: Hwnd; private handle: Hwnd; dc: HDC; @@ -160,6 +162,11 @@ implementation inherited Destroy; end; + function TWindow.GetNativeWindow: Hwnd; + begin + result := handle; + end; + function TWindow.TargetValid: boolean; begin result:= IsWindow(handle);