From 5d1ffa2c7d9b7be2b5ab2ae666de0ed49a9e6c7d Mon Sep 17 00:00:00 2001 From: Wizzup? Date: Sun, 13 Sep 2009 08:46:25 +0000 Subject: [PATCH] I removed the cts case from the loop (meta-unrolled), as it *really* eats speed. Feel free to test, though. Current results are fast enough for now, but I'm sure we can improve the speed a bit more. I set the optimalisations to -O2 instead of -01, it makes a difference of about 1.5x with CTS 2. Results: W, H = 826, 597 FindColorTolerance, with no hit: CTS0: 11.316831683168 ms CTS1: 25.396039603960 ms CTS2: 37.613861386139 ms git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@50 3f818213-9676-44b0-a9b4-5e4c4e03d09d --- Projects/SAMufasaGUI/project1.lpi | 422 +++++++++++-------- Projects/SAMufasaGUI/project1.lpr | 2 +- Projects/SAMufasaGUI/testunit.lfm | 2 + Projects/SAMufasaGUI/testunit.lrs | 359 ++++++++-------- Tests/PS/colourtest.txt | 42 ++ Units/MMLAddon/PSInc/Wrappers/colour.inc | 11 +- Units/MMLAddon/PSInc/Wrappers/mouse.inc | 9 + Units/MMLAddon/PSInc/Wrappers/other.inc | 10 + Units/MMLAddon/PSInc/pscompile.inc | 74 ++-- Units/MMLAddon/mmlpsthread.pas | 504 ++++++++++++----------- Units/MMLCore/finder.pas | 382 ++++++++++------- Units/MMLCore/window.pas | 4 +- 12 files changed, 1028 insertions(+), 793 deletions(-) create mode 100644 Tests/PS/colourtest.txt create mode 100644 Units/MMLAddon/PSInc/Wrappers/mouse.inc create mode 100644 Units/MMLAddon/PSInc/Wrappers/other.inc diff --git a/Projects/SAMufasaGUI/project1.lpi b/Projects/SAMufasaGUI/project1.lpi index f9381de..e91873e 100644 --- a/Projects/SAMufasaGUI/project1.lpi +++ b/Projects/SAMufasaGUI/project1.lpi @@ -7,7 +7,7 @@ <UseXPManifest Value="True"/> - <ActiveEditorIndexAtStart Value="4"/> + <ActiveEditorIndexAtStart Value="8"/> </General> <VersionInfo> <ProjectVersion Value=""/> @@ -33,15 +33,15 @@ <PackageName Value="LCL"/> </Item2> </RequiredPackages> - <Units Count="92"> + <Units Count="99"> <Unit0> <Filename Value="project1.lpr"/> <IsPartOfProject Value="True"/> <UnitName Value="project1"/> - <CursorPos X="34" Y="11"/> + <CursorPos X="47" Y="11"/> <TopLine Value="1"/> <EditorIndex Value="0"/> - <UsageCount Value="90"/> + <UsageCount Value="98"/> <Loaded Value="True"/> </Unit0> <Unit1> @@ -51,117 +51,117 @@ <UnitName Value="TestUnit"/> <CursorPos X="33" Y="57"/> <TopLine Value="32"/> - <UsageCount Value="53"/> + <UsageCount Value="52"/> </Unit1> <Unit2> <Filename Value="client.pas"/> <UnitName Value="Client"/> <CursorPos X="18" Y="34"/> <TopLine Value="10"/> - <UsageCount Value="53"/> + <UsageCount Value="52"/> </Unit2> <Unit3> <Filename Value="../cogat/Units/CogatUnits/comptypes.pas"/> <UnitName Value="CompTypes"/> <CursorPos X="13" Y="531"/> <TopLine Value="523"/> - <UsageCount Value="20"/> + <UsageCount Value="19"/> </Unit3> <Unit4> <Filename Value="mufasatypes.pas"/> <UnitName Value="MufasaTypes"/> <CursorPos X="52" Y="20"/> <TopLine Value="1"/> - <UsageCount Value="53"/> + <UsageCount Value="52"/> </Unit4> <Unit5> <Filename Value="window.pas"/> <UnitName Value="Window"/> <CursorPos X="4" Y="100"/> <TopLine Value="85"/> - <UsageCount Value="53"/> + <UsageCount Value="52"/> </Unit5> <Unit6> <Filename Value="../Documents/fpc/rtl/inc/systemh.inc"/> <CursorPos X="3" Y="261"/> <TopLine Value="246"/> - <UsageCount Value="6"/> + <UsageCount Value="5"/> </Unit6> <Unit7> <Filename Value="input.pas"/> <UnitName Value="Input"/> <CursorPos X="5" Y="20"/> <TopLine Value="15"/> - <UsageCount Value="52"/> + <UsageCount Value="51"/> </Unit7> <Unit8> <Filename Value="../cogat/Units/CogatUnits/compinput.pas"/> <UnitName Value="CompInput"/> <CursorPos X="43" Y="250"/> <TopLine Value="236"/> - <UsageCount Value="18"/> + <UsageCount Value="17"/> </Unit8> <Unit9> <Filename Value="Units/MMLCore/client.pas"/> <UnitName Value="Client"/> <CursorPos X="46" Y="8"/> <TopLine Value="1"/> - <UsageCount Value="22"/> + <UsageCount Value="21"/> </Unit9> <Unit10> <Filename Value="Units/MMLCore/input.pas"/> <UnitName Value="Input"/> <CursorPos X="1" Y="1"/> <TopLine Value="1"/> - <UsageCount Value="22"/> + <UsageCount Value="21"/> </Unit10> <Unit11> <Filename Value="Units/MMLCore/mufasatypes.pas"/> <UnitName Value="MufasaTypes"/> <CursorPos X="1" Y="1"/> <TopLine Value="1"/> - <UsageCount Value="22"/> + <UsageCount Value="21"/> </Unit11> <Unit12> <Filename Value="Units/MMLCore/window.pas"/> <UnitName Value="Window"/> <CursorPos X="69" Y="254"/> <TopLine Value="251"/> - <UsageCount Value="22"/> + <UsageCount Value="21"/> </Unit12> <Unit13> <Filename Value="Units/MMLCore/windowutil.pas"/> <UnitName Value="windowutil"/> <CursorPos X="54" Y="20"/> <TopLine Value="20"/> - <UsageCount Value="45"/> + <UsageCount Value="44"/> </Unit13> <Unit14> <Filename Value="../Documents/lazarus/lcl/graphics.pp"/> <UnitName Value="Graphics"/> <CursorPos X="15" Y="1287"/> <TopLine Value="1272"/> - <UsageCount Value="15"/> + <UsageCount Value="14"/> </Unit14> <Unit15> <Filename Value="../cogat/Units/CogatUnits/compbitmaps.pas"/> <UnitName Value="CompBitmaps"/> <CursorPos X="1" Y="109"/> <TopLine Value="92"/> - <UsageCount Value="15"/> + <UsageCount Value="14"/> </Unit15> <Unit16> <Filename Value="../Documents/lazarus/lcl/include/rasterimage.inc"/> <CursorPos X="1" Y="1"/> <TopLine Value="691"/> - <UsageCount Value="7"/> + <UsageCount Value="6"/> </Unit16> <Unit17> <Filename Value="../Documents/fpc/packages/x11/src/xlib.pp"/> <UnitName Value="xlib"/> <CursorPos X="47" Y="1272"/> <TopLine Value="1257"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit17> <Unit18> <Filename Value="testunit.pas"/> @@ -172,8 +172,8 @@ <UnitName Value="TestUnit"/> <CursorPos X="24" Y="264"/> <TopLine Value="250"/> - <EditorIndex Value="5"/> - <UsageCount Value="56"/> + <EditorIndex Value="7"/> + <UsageCount Value="64"/> <Loaded Value="True"/> </Unit18> <Unit19> @@ -181,40 +181,40 @@ <UnitName Value="CompColors"/> <CursorPos X="44" Y="914"/> <TopLine Value="897"/> - <UsageCount Value="13"/> + <UsageCount Value="12"/> </Unit19> <Unit20> <Filename Value="../Documents/fpc/packages/x11/src/x.pp"/> <UnitName Value="x"/> <CursorPos X="4" Y="179"/> <TopLine Value="164"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit20> <Unit21> <Filename Value="../Documents/fpc/rtl/unix/aliasctp.inc"/> <CursorPos X="63" Y="45"/> <TopLine Value="30"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit21> <Unit22> <Filename Value="../cogat/Units/CogatUnits/compdragger.pas"/> <UnitName Value="CompDragger"/> <CursorPos X="33" Y="14"/> <TopLine Value="6"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit22> <Unit23> <Filename Value="../Documents/lazarus/lcl/lcltype.pp"/> <UnitName Value="LCLType"/> <CursorPos X="9" Y="99"/> <TopLine Value="83"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit23> <Unit24> <Filename Value="testunit.lfm"/> <CursorPos X="1" Y="1"/> <TopLine Value="1"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> <SyntaxHighlighter Value="LFM"/> </Unit24> <Unit25> @@ -222,100 +222,100 @@ <UnitName Value="Unix"/> <CursorPos X="63" Y="63"/> <TopLine Value="56"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit25> <Unit26> <Filename Value="../Compilertje/Units/CogatUnits/compinput.pas"/> <UnitName Value="CompInput"/> <CursorPos X="6" Y="462"/> <TopLine Value="449"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit26> <Unit27> <Filename Value="../FPC/FPCCheckout/rtl/win/wininc/func.inc"/> <CursorPos X="10" Y="663"/> <TopLine Value="635"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit27> <Unit28> <Filename Value="../Compilertje/Units/CogatUnits/comptypes.pas"/> <UnitName Value="CompTypes"/> <CursorPos X="13" Y="418"/> <TopLine Value="402"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit28> <Unit29> <Filename Value="../Compilertje/Units/CogatUnits/compcolors.pas"/> <UnitName Value="CompColors"/> <CursorPos X="12" Y="603"/> <TopLine Value="573"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit29> <Unit30> <Filename Value="../lazarus/lcl/graphics.pp"/> <UnitName Value="Graphics"/> <CursorPos X="15" Y="1283"/> <TopLine Value="1270"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit30> <Unit31> <Filename Value="../lazarus/lcl/include/rasterimage.inc"/> <CursorPos X="20" Y="351"/> <TopLine Value="339"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit31> <Unit32> <Filename Value="../lazarus/lcl/intfgraphics.pas"/> <UnitName Value="IntfGraphics"/> <CursorPos X="3" Y="3251"/> <TopLine Value="3245"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit32> <Unit33> <Filename Value="../../Documents/fpc/packages/fcl-image/src/fpcanvas.pp"/> <UnitName Value="FPCanvas"/> <CursorPos X="23" Y="257"/> <TopLine Value="142"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit33> <Unit34> <Filename Value="../../Documents/fpc/packages/fcl-image/src/fpimage.pp"/> <UnitName Value="FPimage"/> <CursorPos X="3" Y="58"/> <TopLine Value="43"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit34> <Unit35> <Filename Value="../../Documents/fpc/packages/fcl-image/src/fpimage.inc"/> <CursorPos X="24" Y="25"/> <TopLine Value="1"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit35> <Unit36> <Filename Value="../../Documents/lazarus/lcl/graphics.pp"/> <UnitName Value="Graphics"/> <CursorPos X="88" Y="2395"/> <TopLine Value="2388"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit36> <Unit37> <Filename Value="../../Units/MMLCore/client.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="Client"/> - <CursorPos X="29" Y="12"/> - <TopLine Value="1"/> - <EditorIndex Value="4"/> - <UsageCount Value="55"/> + <CursorPos X="2" Y="35"/> + <TopLine Value="20"/> + <EditorIndex Value="6"/> + <UsageCount Value="63"/> <Loaded Value="True"/> </Unit37> <Unit38> <Filename Value="../../Units/MMLCore/mufasatypes.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="MufasaTypes"/> - <CursorPos X="27" Y="19"/> + <CursorPos X="1" Y="1"/> <TopLine Value="1"/> - <EditorIndex Value="3"/> - <UsageCount Value="55"/> + <EditorIndex Value="5"/> + <UsageCount Value="63"/> <Loaded Value="True"/> </Unit38> <Unit39> @@ -323,26 +323,24 @@ <UnitName Value="compFiles"/> <CursorPos X="18" Y="8"/> <TopLine Value="1"/> - <UsageCount Value="23"/> + <UsageCount Value="22"/> </Unit39> <Unit40> <Filename Value="../../Units/MMLCore/files.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="files"/> - <CursorPos X="25" Y="64"/> - <TopLine Value="34"/> - <EditorIndex Value="9"/> - <UsageCount Value="56"/> - <Loaded Value="True"/> + <CursorPos X="37" Y="42"/> + <TopLine Value="271"/> + <UsageCount Value="64"/> </Unit40> <Unit41> <Filename Value="../../Units/MMLCore/window.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="Window"/> - <CursorPos X="40" Y="263"/> - <TopLine Value="263"/> - <EditorIndex Value="10"/> - <UsageCount Value="55"/> + <CursorPos X="53" Y="226"/> + <TopLine Value="208"/> + <EditorIndex Value="11"/> + <UsageCount Value="63"/> <Loaded Value="True"/> </Unit41> <Unit42> @@ -350,22 +348,22 @@ <UnitName Value="Forms"/> <CursorPos X="15" Y="1236"/> <TopLine Value="981"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit42> <Unit43> <Filename Value="../../../cogat/Units/CogatUnits/comptypes.pas"/> <UnitName Value="CompTypes"/> <CursorPos X="80" Y="9"/> <TopLine Value="1"/> - <UsageCount Value="13"/> + <UsageCount Value="12"/> </Unit43> <Unit44> <Filename Value="../../Units/MMLCore/windowutil.pas"/> <UnitName Value="windowutil"/> <CursorPos X="96" Y="86"/> <TopLine Value="75"/> - <EditorIndex Value="11"/> - <UsageCount Value="18"/> + <EditorIndex Value="12"/> + <UsageCount Value="22"/> <Loaded Value="True"/> </Unit44> <Unit45> @@ -373,16 +371,16 @@ <UnitName Value="Input"/> <CursorPos X="3" Y="90"/> <TopLine Value="59"/> - <UsageCount Value="16"/> + <UsageCount Value="15"/> </Unit45> <Unit46> <Filename Value="../../Units/MMLCore/finder.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="finder"/> - <CursorPos X="27" Y="65"/> - <TopLine Value="41"/> - <EditorIndex Value="2"/> - <UsageCount Value="48"/> + <CursorPos X="54" Y="220"/> + <TopLine Value="202"/> + <EditorIndex Value="1"/> + <UsageCount Value="56"/> <Loaded Value="True"/> </Unit46> <Unit47> @@ -390,7 +388,7 @@ <UnitName Value="Graphics"/> <CursorPos X="17" Y="1353"/> <TopLine Value="1341"/> - <UsageCount Value="15"/> + <UsageCount Value="14"/> </Unit47> <Unit48> <Filename Value="../../Units/MMLAddon/mmlthread.pas"/> @@ -398,22 +396,22 @@ <UnitName Value="MMLThread"/> <CursorPos X="132" Y="5"/> <TopLine Value="1"/> - <UsageCount Value="46"/> + <UsageCount Value="54"/> </Unit48> <Unit49> <Filename Value="../../../Documents/fpc/rtl/objpas/classes/classesh.inc"/> <CursorPos X="27" Y="1430"/> <TopLine Value="1422"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit49> <Unit50> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="mmlpsthread"/> - <CursorPos X="31" Y="132"/> - <TopLine Value="107"/> - <EditorIndex Value="6"/> - <UsageCount Value="44"/> + <CursorPos X="28" Y="102"/> + <TopLine Value="86"/> + <EditorIndex Value="8"/> + <UsageCount Value="52"/> <Loaded Value="True"/> </Unit50> <Unit51> @@ -421,134 +419,132 @@ <UnitName Value="uPSComponent"/> <CursorPos X="21" Y="193"/> <TopLine Value="183"/> - <UsageCount Value="18"/> + <UsageCount Value="17"/> </Unit51> <Unit52> <Filename Value="../../../FPC/FPCCheckout/rtl/objpas/classes/classesh.inc"/> <CursorPos X="30" Y="260"/> <TopLine Value="244"/> - <UsageCount Value="15"/> + <UsageCount Value="14"/> </Unit52> <Unit53> <Filename Value="../../../FPC/FPCCheckout/rtl/objpas/types.pp"/> <UnitName Value="types"/> <CursorPos X="1" Y="1"/> <TopLine Value="1"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit53> <Unit54> <Filename Value="../../../FPC/FPCCheckout/rtl/objpas/typinfo.pp"/> <UnitName Value="typinfo"/> <CursorPos X="1" Y="1"/> <TopLine Value="1"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit54> <Unit55> <Filename Value="../../Units/PascalScript/uPSC_forms.pas"/> <UnitName Value="uPSC_forms"/> <CursorPos X="1" Y="1"/> <TopLine Value="1"/> - <UsageCount Value="17"/> + <UsageCount Value="16"/> </Unit55> <Unit56> <Filename Value="project1.lrs"/> <CursorPos X="70" Y="41"/> <TopLine Value="11"/> - <EditorIndex Value="1"/> - <UsageCount Value="22"/> - <Loaded Value="True"/> + <UsageCount Value="25"/> </Unit56> <Unit57> <Filename Value="../../../lazarus/lcl/lresources.pp"/> <UnitName Value="LResources"/> <CursorPos X="3" Y="1396"/> <TopLine Value="1396"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit57> <Unit58> <Filename Value="../../../lazarus/components/synedit/synmemo.pas"/> <UnitName Value="SynMemo"/> <CursorPos X="16" Y="150"/> <TopLine Value="31"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit58> <Unit59> <Filename Value="../../../lazarus/components/synedit/syneditmiscclasses.pp"/> <UnitName Value="SynEditMiscClasses"/> <CursorPos X="29" Y="100"/> <TopLine Value="92"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit59> <Unit60> <Filename Value="../../../lazarus/components/synedit/synedit.pp"/> <UnitName Value="SynEdit"/> <CursorPos X="22" Y="1531"/> <TopLine Value="1523"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit60> <Unit61> <Filename Value="../../../lazarus/components/synedit/syngutterchanges.pas"/> <UnitName Value="SynGutterChanges"/> <CursorPos X="34" Y="126"/> <TopLine Value="118"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit61> <Unit62> <Filename Value="../../../lazarus/components/synedit/syneditlines.pas"/> <UnitName Value="SynEditLines"/> <CursorPos X="21" Y="48"/> <TopLine Value="40"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit62> <Unit63> <Filename Value="../../../lazarus/components/synedit/synedittextbase.pas"/> <UnitName Value="SynEditTextBase"/> <CursorPos X="3" Y="75"/> <TopLine Value="124"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit63> <Unit64> <Filename Value="../../Units/PascalScript/uPSC_std.pas"/> <UnitName Value="uPSC_std"/> <CursorPos X="35" Y="8"/> <TopLine Value="1"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit64> <Unit65> <Filename Value="../../Units/PascalScript/uPSC_controls.pas"/> <UnitName Value="uPSC_controls"/> <CursorPos X="1" Y="1"/> <TopLine Value="11"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit65> <Unit66> <Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/> - <CursorPos X="31" Y="10"/> + <CursorPos X="44" Y="18"/> <TopLine Value="1"/> - <EditorIndex Value="7"/> - <UsageCount Value="16"/> + <EditorIndex Value="10"/> + <UsageCount Value="20"/> <Loaded Value="True"/> </Unit66> <Unit67> <Filename Value="../../../FPC/FPCCheckout/rtl/win/tthread.inc"/> <CursorPos X="15" Y="17"/> <TopLine Value="12"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit67> <Unit68> <Filename Value="../../../FPC/FPCCheckout/rtl/inc/objpash.inc"/> <CursorPos X="21" Y="184"/> <TopLine Value="167"/> - <UsageCount Value="14"/> + <UsageCount Value="13"/> </Unit68> <Unit69> <Filename Value="../../Units/MMLCore/bitmaps.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="bitmaps"/> - <CursorPos X="33" Y="84"/> - <TopLine Value="74"/> - <EditorIndex Value="12"/> - <UsageCount Value="34"/> + <CursorPos X="1" Y="1"/> + <TopLine Value="1"/> + <EditorIndex Value="13"/> + <UsageCount Value="42"/> <Loaded Value="True"/> </Unit69> <Unit70> @@ -556,253 +552,321 @@ <UnitName Value="FPCanvas"/> <CursorPos X="96" Y="409"/> <TopLine Value="188"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit70> <Unit71> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/colour.inc"/> - <CursorPos X="35" Y="9"/> + <CursorPos X="1" Y="8"/> <TopLine Value="1"/> - <UsageCount Value="11"/> + <EditorIndex Value="9"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> </Unit71> <Unit72> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/bitmap.inc"/> <IsPartOfProject Value="True"/> <CursorPos X="13" Y="43"/> - <TopLine Value="13"/> - <EditorIndex Value="8"/> - <UsageCount Value="33"/> - <Loaded Value="True"/> + <TopLine Value="1"/> + <UsageCount Value="41"/> </Unit72> <Unit73> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpcanvas.inc"/> <CursorPos X="16" Y="20"/> <TopLine Value="18"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit73> <Unit74> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/examples/drawing.pp"/> <UnitName Value="Drawing"/> <CursorPos X="20" Y="19"/> <TopLine Value="1"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit74> <Unit75> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpimgcanv.pp"/> <UnitName Value="FPImgCanv"/> <CursorPos X="32" Y="23"/> <TopLine Value="13"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit75> <Unit76> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fppixlcanv.pp"/> <UnitName Value="FPPixlCanv"/> <CursorPos X="3" Y="31"/> <TopLine Value="32"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit76> <Unit77> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpimage.pp"/> <UnitName Value="FPimage"/> <CursorPos X="17" Y="129"/> <TopLine Value="112"/> - <UsageCount Value="14"/> + <UsageCount Value="13"/> </Unit77> <Unit78> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpimage.inc"/> <CursorPos X="3" Y="44"/> <TopLine Value="40"/> - <UsageCount Value="14"/> + <UsageCount Value="13"/> </Unit78> <Unit79> <Filename Value="../../../lazarus/lcl/lclintf.pas"/> <UnitName Value="LCLIntf"/> <CursorPos X="1" Y="1"/> <TopLine Value="1"/> - <UsageCount Value="11"/> + <UsageCount Value="10"/> </Unit79> <Unit80> <Filename Value="../../../lazarus/lcl/intfgraphics.pas"/> <UnitName Value="IntfGraphics"/> <CursorPos X="84" Y="1334"/> <TopLine Value="1334"/> - <UsageCount Value="14"/> + <UsageCount Value="13"/> </Unit80> <Unit81> <Filename Value="../../../lazarus/lcl/graphtype.pp"/> <UnitName Value="GraphType"/> <CursorPos X="19" Y="634"/> <TopLine Value="630"/> - <UsageCount Value="15"/> + <UsageCount Value="14"/> </Unit81> <Unit82> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpcolors.inc"/> <CursorPos X="24" Y="21"/> <TopLine Value="12"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit82> <Unit83> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fppalette.inc"/> <CursorPos X="3" Y="19"/> <TopLine Value="4"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit83> <Unit84> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fphandler.inc"/> <CursorPos X="18" Y="268"/> <TopLine Value="241"/> - <UsageCount Value="11"/> + <UsageCount Value="10"/> </Unit84> <Unit85> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpwritebmp.pp"/> <UnitName Value="FPWriteBMP"/> <CursorPos X="28" Y="722"/> <TopLine Value="698"/> - <UsageCount Value="11"/> + <UsageCount Value="10"/> </Unit85> <Unit86> <Filename Value="../../../lazarus/lcl/include/rasterimage.inc"/> <CursorPos X="3" Y="571"/> <TopLine Value="567"/> - <UsageCount Value="11"/> + <UsageCount Value="10"/> </Unit86> <Unit87> <Filename Value="../../../lazarus/lcl/include/custombitmap.inc"/> <CursorPos X="3" Y="98"/> <TopLine Value="96"/> - <UsageCount Value="13"/> + <UsageCount Value="12"/> </Unit87> <Unit88> <Filename Value="../../../Compilertje/Units/CogatUnits/compmaths.pas"/> <UnitName Value="CompMaths"/> <CursorPos X="26" Y="43"/> <TopLine Value="14"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit88> <Unit89> <Filename Value="../../../FPC/FPCCheckout/rtl/objpas/math.pp"/> <UnitName Value="math"/> <CursorPos X="1" Y="1"/> <TopLine Value="1"/> - <UsageCount Value="13"/> + <UsageCount Value="12"/> </Unit89> <Unit90> <Filename Value="../../../FPC/FPCCheckout/rtl/inc/systemh.inc"/> <CursorPos X="11" Y="513"/> <TopLine Value="496"/> - <UsageCount Value="11"/> + <UsageCount Value="10"/> </Unit90> <Unit91> <Filename Value="../../../FPC/FPCCheckout/rtl/i386/fastmove.inc"/> <CursorPos X="44" Y="836"/> <TopLine Value="817"/> - <UsageCount Value="11"/> + <UsageCount Value="10"/> </Unit91> + <Unit92> + <Filename Value="../../Units/MMLCore/colour_conv.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="colour_conv"/> + <CursorPos X="32" Y="103"/> + <TopLine Value="103"/> + <EditorIndex Value="3"/> + <UsageCount Value="24"/> + <Loaded Value="True"/> + </Unit92> + <Unit93> + <Filename Value="../../../cogat/Units/CogatUnits/compcolors.pas"/> + <UnitName Value="CompColors"/> + <CursorPos X="19" Y="80"/> + <TopLine Value="75"/> + <EditorIndex Value="4"/> + <UsageCount Value="12"/> + <Loaded Value="True"/> + </Unit93> + <Unit94> + <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/mouse.inc"/> + <CursorPos X="65" Y="9"/> + <TopLine Value="1"/> + <UsageCount Value="10"/> + </Unit94> + <Unit95> + <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/other.inc"/> + <CursorPos X="1" Y="1"/> + <TopLine Value="1"/> + <UsageCount Value="10"/> + </Unit95> + <Unit96> + <Filename Value="../../Units/PascalScript/uPSCompiler.pas"/> + <UnitName Value="uPSCompiler"/> + <CursorPos X="1" Y="13147"/> + <TopLine Value="13132"/> + <UsageCount Value="10"/> + </Unit96> + <Unit97> + <Filename Value="../../Units/MMLCore/macro/ColorSame.inc"/> + <CursorPos X="37" Y="5"/> + <TopLine Value="1"/> + <UsageCount Value="10"/> + </Unit97> + <Unit98> + <Filename Value="../../../../Documents/fpc/rtl/inc/mathh.inc"/> + <CursorPos X="19" Y="58"/> + <TopLine Value="56"/> + <EditorIndex Value="2"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit98> </Units> - <JumpHistory Count="26" HistoryIndex="25"> + <JumpHistory Count="30" HistoryIndex="29"> <Position1> - <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> - <Caret Line="132" Column="31" TopLine="106"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="180" Column="29" TopLine="159"/> </Position1> <Position2> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="107" Column="21" TopLine="100"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="191" Column="22" TopLine="169"/> </Position2> <Position3> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="30" Column="43" TopLine="28"/> + <Filename Value="../../../cogat/Units/CogatUnits/compcolors.pas"/> + <Caret Line="44" Column="44" TopLine="31"/> </Position3> <Position4> - <Filename Value="../../Units/MMLCore/mufasatypes.pas"/> - <Caret Line="20" Column="12" TopLine="1"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="160" Column="31" TopLine="140"/> </Position4> <Position5> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="37" Column="54" TopLine="19"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="39" Column="50" TopLine="31"/> </Position5> <Position6> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="85" Column="5" TopLine="51"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="28" Column="36" TopLine="14"/> </Position6> <Position7> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="80" Column="26" TopLine="63"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="40" Column="21" TopLine="25"/> </Position7> <Position8> - <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> - <Caret Line="145" Column="17" TopLine="123"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="73" Column="18" TopLine="53"/> </Position8> <Position9> - <Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/> - <Caret Line="8" Column="30" TopLine="1"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="81" Column="19" TopLine="58"/> </Position9> <Position10> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="36" Column="60" TopLine="22"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="27" Column="48" TopLine="15"/> </Position10> <Position11> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="94" Column="67" TopLine="76"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="74" Column="6" TopLine="60"/> </Position11> <Position12> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="230" Column="5" TopLine="196"/> + <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> + <Caret Line="136" Column="23" TopLine="121"/> </Position12> <Position13> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="234" Column="22" TopLine="212"/> + <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> + <Caret Line="134" Column="23" TopLine="121"/> </Position13> <Position14> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="234" Column="9" TopLine="209"/> + <Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/> + <Caret Line="4" Column="2" TopLine="1"/> </Position14> <Position15> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="229" Column="19" TopLine="212"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="37" Column="22" TopLine="18"/> </Position15> <Position16> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="109" Column="39" TopLine="106"/> + <Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/> + <Caret Line="17" Column="1" TopLine="1"/> </Position16> <Position17> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="247" Column="36" TopLine="230"/> + <Filename Value="../../Units/MMLCore/window.pas"/> + <Caret Line="314" Column="49" TopLine="285"/> </Position17> <Position18> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="223" Column="68" TopLine="201"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="183" Column="20" TopLine="163"/> </Position18> <Position19> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="225" Column="21" TopLine="202"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="199" Column="63" TopLine="172"/> </Position19> <Position20> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="219" Column="23" TopLine="196"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="202" Column="7" TopLine="174"/> </Position20> <Position21> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="211" Column="60" TopLine="196"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="179" Column="8" TopLine="164"/> </Position21> <Position22> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="230" Column="3" TopLine="206"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="207" Column="3" TopLine="183"/> </Position22> <Position23> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="233" Column="3" TopLine="206"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="204" Column="1" TopLine="181"/> </Position23> <Position24> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="224" Column="60" TopLine="209"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="185" Column="12" TopLine="172"/> </Position24> <Position25> - <Filename Value="../../Units/MMLCore/bitmaps.pas"/> - <Caret Line="86" Column="5" TopLine="31"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="216" Column="23" TopLine="195"/> </Position25> <Position26> - <Filename Value="../../Units/MMLCore/client.pas"/> - <Caret Line="1" Column="38" TopLine="1"/> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="203" Column="6" TopLine="184"/> </Position26> + <Position27> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="195" Column="10" TopLine="184"/> + </Position27> + <Position28> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="198" Column="21" TopLine="183"/> + </Position28> + <Position29> + <Filename Value="../../Units/MMLCore/finder.pas"/> + <Caret Line="152" Column="24" TopLine="143"/> + </Position29> + <Position30> + <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> + <Caret Line="138" Column="25" TopLine="114"/> + </Position30> </JumpHistory> </ProjectOptions> <CompilerOptions> diff --git a/Projects/SAMufasaGUI/project1.lpr b/Projects/SAMufasaGUI/project1.lpr index ed34edf..022891e 100644 --- a/Projects/SAMufasaGUI/project1.lpr +++ b/Projects/SAMufasaGUI/project1.lpr @@ -8,7 +8,7 @@ uses {$ENDIF}{$ENDIF} Interfaces, // this includes the LCL widgetset Forms, LResources, Window, files, MufasaTypes, Client, TestUnit, finder, - MMLThread, mmlpsthread, bitmaps; + MMLThread, mmlpsthread, bitmaps, colour_conv; {$IFDEF WINDOWS}{$R project1.rc}{$ENDIF} diff --git a/Projects/SAMufasaGUI/testunit.lfm b/Projects/SAMufasaGUI/testunit.lfm index b59b445..53b6216 100644 --- a/Projects/SAMufasaGUI/testunit.lfm +++ b/Projects/SAMufasaGUI/testunit.lfm @@ -32,6 +32,7 @@ object Form1: TForm1 ParentColor = False ParentFont = False TabOrder = 1 + BookMarkOptions.OnChange = nil Gutter.Width = 61 Gutter.MouseActions = < item @@ -728,6 +729,7 @@ object Form1: TForm1 ParentColor = False ParentFont = False TabOrder = 2 + BookMarkOptions.OnChange = nil Gutter.Width = 61 Gutter.MouseActions = < item diff --git a/Projects/SAMufasaGUI/testunit.lrs b/Projects/SAMufasaGUI/testunit.lrs index 522ffff..321d362 100644 --- a/Projects/SAMufasaGUI/testunit.lrs +++ b/Projects/SAMufasaGUI/testunit.lrs @@ -10,18 +10,156 @@ LazarusResources.Add('TForm1','FORMDATA',[ +'t'#2#8#6'Height'#3'('#1#3'Top'#2'@'#5'Width'#3#216#2#5'Align'#7#8'alCustom' +#11'Font.Height'#2#243#9'Font.Name'#6#11'Courier New'#10'Font.Pitch'#7#7'fpF' +'ixed'#12'Font.Quality'#7#16'fqNonAntialiased'#11'ParentColor'#8#10'ParentFo' - +'nt'#8#8'TabOrder'#2#1#12'Gutter.Width'#2'='#19'Gutter.MouseActions'#14#1#5 - +'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAn' - +'y'#8'ClickDir'#7#6'cdDown'#7'Command'#2#13#9'MoveCaret'#8#6'Option'#2#0#8'P' - +'riority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10 - +'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2#12#9'MoveCaret' - +#8#6'Option'#2#0#8'Priority'#2#0#0#0#11'Highlighter'#7#17'SynFreePascalSyn1' - +#10'Keystrokes'#14#1#7'Command'#7#4'ecUp'#8'ShortCut'#2'&'#0#1#7'Command'#7#7 - +'ecSelUp'#8'ShortCut'#3'& '#0#1#7'Command'#7#10'ecScrollUp'#8'ShortCut'#3'&@' - +#0#1#7'Command'#7#6'ecDown'#8'ShortCut'#2'('#0#1#7'Command'#7#9'ecSelDown'#8 - +'ShortCut'#3'( '#0#1#7'Command'#7#12'ecScrollDown'#8'ShortCut'#3'(@'#0#1#7'C' - +'ommand'#7#6'ecLeft'#8'ShortCut'#2'%'#0#1#7'Command'#7#9'ecSelLeft'#8'ShortC' - +'ut'#3'% '#0#1#7'Command'#7#10'ecWordLeft'#8'ShortCut'#3'%@'#0#1#7'Command'#7 + +'nt'#8#8'TabOrder'#2#1#24'BookMarkOptions.OnChange'#13#12'Gutter.Width'#2'=' + +#19'Gutter.MouseActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6 + +'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#13#9 + +'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11 + +#0#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp' + +#7'Command'#2#12#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#11'Highlig' + +'hter'#7#17'SynFreePascalSyn1'#10'Keystrokes'#14#1#7'Command'#7#4'ecUp'#8'Sh' + +'ortCut'#2'&'#0#1#7'Command'#7#7'ecSelUp'#8'ShortCut'#3'& '#0#1#7'Command'#7 + +#10'ecScrollUp'#8'ShortCut'#3'&@'#0#1#7'Command'#7#6'ecDown'#8'ShortCut'#2'(' + +#0#1#7'Command'#7#9'ecSelDown'#8'ShortCut'#3'( '#0#1#7'Command'#7#12'ecScrol' + +'lDown'#8'ShortCut'#3'(@'#0#1#7'Command'#7#6'ecLeft'#8'ShortCut'#2'%'#0#1#7 + +'Command'#7#9'ecSelLeft'#8'ShortCut'#3'% '#0#1#7'Command'#7#10'ecWordLeft'#8 + +'ShortCut'#3'%@'#0#1#7'Command'#7#13'ecSelWordLeft'#8'ShortCut'#3'%`'#0#1#7 + +'Command'#7#7'ecRight'#8'ShortCut'#2''''#0#1#7'Command'#7#10'ecSelRight'#8'S' + +'hortCut'#3''' '#0#1#7'Command'#7#11'ecWordRight'#8'ShortCut'#3'''@'#0#1#7'C' + +'ommand'#7#14'ecSelWordRight'#8'ShortCut'#3'''`'#0#1#7'Command'#7#10'ecPageD' + +'own'#8'ShortCut'#2'"'#0#1#7'Command'#7#13'ecSelPageDown'#8'ShortCut'#3'" '#0 + +#1#7'Command'#7#12'ecPageBottom'#8'ShortCut'#3'"@'#0#1#7'Command'#7#15'ecSel' + +'PageBottom'#8'ShortCut'#3'"`'#0#1#7'Command'#7#8'ecPageUp'#8'ShortCut'#2'!' + +#0#1#7'Command'#7#11'ecSelPageUp'#8'ShortCut'#3'! '#0#1#7'Command'#7#9'ecPag' + +'eTop'#8'ShortCut'#3'!@'#0#1#7'Command'#7#12'ecSelPageTop'#8'ShortCut'#3'!`' + +#0#1#7'Command'#7#11'ecLineStart'#8'ShortCut'#2'$'#0#1#7'Command'#7#14'ecSel' + +'LineStart'#8'ShortCut'#3'$ '#0#1#7'Command'#7#11'ecEditorTop'#8'ShortCut'#3 + +'$@'#0#1#7'Command'#7#14'ecSelEditorTop'#8'ShortCut'#3'$`'#0#1#7'Command'#7#9 + +'ecLineEnd'#8'ShortCut'#2'#'#0#1#7'Command'#7#12'ecSelLineEnd'#8'ShortCut'#3 + +'# '#0#1#7'Command'#7#14'ecEditorBottom'#8'ShortCut'#3'#@'#0#1#7'Command'#7 + +#17'ecSelEditorBottom'#8'ShortCut'#3'#`'#0#1#7'Command'#7#12'ecToggleMode'#8 + +'ShortCut'#2'-'#0#1#7'Command'#7#6'ecCopy'#8'ShortCut'#3'-@'#0#1#7'Command'#7 + +#7'ecPaste'#8'ShortCut'#3'- '#0#1#7'Command'#7#12'ecDeleteChar'#8'ShortCut'#2 + +'.'#0#1#7'Command'#7#5'ecCut'#8'ShortCut'#3'. '#0#1#7'Command'#7#16'ecDelete' + +'LastChar'#8'ShortCut'#2#8#0#1#7'Command'#7#16'ecDeleteLastChar'#8'ShortCut' + +#3#8' '#0#1#7'Command'#7#16'ecDeleteLastWord'#8'ShortCut'#3#8'@'#0#1#7'Comma' + +'nd'#7#6'ecUndo'#8'ShortCut'#4#8#128#0#0#0#1#7'Command'#7#6'ecRedo'#8'ShortC' + +'ut'#4#8#160#0#0#0#1#7'Command'#7#11'ecLineBreak'#8'ShortCut'#2#13#0#1#7'Com' + +'mand'#7#11'ecSelectAll'#8'ShortCut'#3'A@'#0#1#7'Command'#7#6'ecCopy'#8'Shor' + +'tCut'#3'C@'#0#1#7'Command'#7#13'ecBlockIndent'#8'ShortCut'#3'I`'#0#1#7'Comm' + +'and'#7#11'ecLineBreak'#8'ShortCut'#3'M@'#0#1#7'Command'#7#12'ecInsertLine'#8 + +'ShortCut'#3'N@'#0#1#7'Command'#7#12'ecDeleteWord'#8'ShortCut'#3'T@'#0#1#7'C' + +'ommand'#7#15'ecBlockUnindent'#8'ShortCut'#3'U`'#0#1#7'Command'#7#7'ecPaste' + +#8'ShortCut'#3'V@'#0#1#7'Command'#7#5'ecCut'#8'ShortCut'#3'X@'#0#1#7'Command' + +#7#12'ecDeleteLine'#8'ShortCut'#3'Y@'#0#1#7'Command'#7#11'ecDeleteEOL'#8'Sho' + +'rtCut'#3'Y`'#0#1#7'Command'#7#6'ecUndo'#8'ShortCut'#3'Z@'#0#1#7'Command'#7#6 + +'ecRedo'#8'ShortCut'#3'Z`'#0#1#7'Command'#7#13'ecGotoMarker0'#8'ShortCut'#3 + +'0@'#0#1#7'Command'#7#13'ecGotoMarker1'#8'ShortCut'#3'1@'#0#1#7'Command'#7#13 + +'ecGotoMarker2'#8'ShortCut'#3'2@'#0#1#7'Command'#7#13'ecGotoMarker3'#8'Short' + +'Cut'#3'3@'#0#1#7'Command'#7#13'ecGotoMarker4'#8'ShortCut'#3'4@'#0#1#7'Comma' + +'nd'#7#13'ecGotoMarker5'#8'ShortCut'#3'5@'#0#1#7'Command'#7#13'ecGotoMarker6' + +#8'ShortCut'#3'6@'#0#1#7'Command'#7#13'ecGotoMarker7'#8'ShortCut'#3'7@'#0#1#7 + +'Command'#7#13'ecGotoMarker8'#8'ShortCut'#3'8@'#0#1#7'Command'#7#13'ecGotoMa' + +'rker9'#8'ShortCut'#3'9@'#0#1#7'Command'#7#12'ecSetMarker0'#8'ShortCut'#3'0`' + +#0#1#7'Command'#7#12'ecSetMarker1'#8'ShortCut'#3'1`'#0#1#7'Command'#7#12'ecS' + +'etMarker2'#8'ShortCut'#3'2`'#0#1#7'Command'#7#12'ecSetMarker3'#8'ShortCut'#3 + +'3`'#0#1#7'Command'#7#12'ecSetMarker4'#8'ShortCut'#3'4`'#0#1#7'Command'#7#12 + +'ecSetMarker5'#8'ShortCut'#3'5`'#0#1#7'Command'#7#12'ecSetMarker6'#8'ShortCu' + +'t'#3'6`'#0#1#7'Command'#7#12'ecSetMarker7'#8'ShortCut'#3'7`'#0#1#7'Command' + ,#7#12'ecSetMarker8'#8'ShortCut'#3'8`'#0#1#7'Command'#7#12'ecSetMarker9'#8'Sh' + +'ortCut'#3'9`'#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'1'#160#0#0#0#1 + +#7'Command'#7#12'EcFoldLevel2'#8'ShortCut'#4'2'#160#0#0#0#1#7'Command'#7#12 + +'EcFoldLevel1'#8'ShortCut'#4'3'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8 + +'ShortCut'#4'4'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'5' + +#160#0#0#0#1#7'Command'#7#12'EcFoldLevel6'#8'ShortCut'#4'6'#160#0#0#0#1#7'Co' + +'mmand'#7#12'EcFoldLevel7'#8'ShortCut'#4'7'#160#0#0#0#1#7'Command'#7#12'EcFo' + +'ldLevel8'#8'ShortCut'#4'8'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel9'#8'Shor' + +'tCut'#4'9'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel0'#8'ShortCut'#4'0'#160#0 + +#0#0#1#7'Command'#7#13'EcFoldCurrent'#8'ShortCut'#4'-'#160#0#0#0#1#7'Command' + +#7#15'EcUnFoldCurrent'#8'ShortCut'#4'+'#160#0#0#0#1#7'Command'#7#18'EcToggle' + +'MarkupWord'#8'ShortCut'#4'M'#128#0#0#0#1#7'Command'#7#14'ecNormalSelect'#8 + +'ShortCut'#3'N`'#0#1#7'Command'#7#14'ecColumnSelect'#8'ShortCut'#3'C`'#0#1#7 + +'Command'#7#12'ecLineSelect'#8'ShortCut'#3'L`'#0#1#7'Command'#7#5'ecTab'#8'S' + +'hortCut'#2#9#0#1#7'Command'#7#10'ecShiftTab'#8'ShortCut'#3#9' '#0#1#7'Comma' + +'nd'#7#14'ecMatchBracket'#8'ShortCut'#3'B`'#0#1#7'Command'#7#10'ecColSelUp'#8 + +'ShortCut'#4'&'#160#0#0#0#1#7'Command'#7#12'ecColSelDown'#8'ShortCut'#4'(' + +#160#0#0#0#1#7'Command'#7#12'ecColSelLeft'#8'ShortCut'#4'%'#160#0#0#0#1#7'Co' + +'mmand'#7#13'ecColSelRight'#8'ShortCut'#4''''#160#0#0#0#1#7'Command'#7#16'ec' + +'ColSelPageDown'#8'ShortCut'#4'"'#160#0#0#0#1#7'Command'#7#18'ecColSelPageBo' + +'ttom'#8'ShortCut'#4'"'#224#0#0#0#1#7'Command'#7#14'ecColSelPageUp'#8'ShortC' + +'ut'#4'!'#160#0#0#0#1#7'Command'#7#15'ecColSelPageTop'#8'ShortCut'#4'!'#224#0 + +#0#0#1#7'Command'#7#17'ecColSelLineStart'#8'ShortCut'#4'$'#160#0#0#0#1#7'Com' + +'mand'#7#15'ecColSelLineEnd'#8'ShortCut'#4'#'#160#0#0#0#1#7'Command'#7#17'ec' + +'ColSelEditorTop'#8'ShortCut'#4'$'#224#0#0#0#1#7'Command'#7#20'ecColSelEdito' + +'rBottom'#8'ShortCut'#4'#'#224#0#0#0#0#12'MouseActions'#14#1#5'Shift'#11#0#9 + +'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8 + +'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#1#9'MoveCaret'#9#6'Option'#2 + +#0#8'Priority'#2#0#0#1#5'Shift'#11#7'ssShift'#0#9'ShiftMask'#11#7'ssShift'#5 + +'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6 + +'cdDown'#7'Command'#2#1#9'MoveCaret'#9#6'Option'#2#1#8'Priority'#2#0#0#1#5'S' + +'hift'#11#5'ssAlt'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'Button'#7#6'mbL' + +'eft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#3#9 + +'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#7'ssShift'#5'ssA' + +'lt'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickC' + +'ount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#3#9'MoveCaret'#9#6 + +'Option'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7 + +#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2 + +#12#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMa' + +'sk'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccDouble'#8'ClickDir'#7#6 + +'cdDown'#7'Command'#2#6#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'S' + +'hift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccTri' + +'ple'#8'ClickDir'#7#6'cdDown'#7'Command'#2#7#9'MoveCaret'#9#6'Option'#2#0#8 + +'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10 + +'ClickCount'#7#6'ccQuad'#8'ClickDir'#7#6'cdDown'#7'Command'#2#8#9'MoveCaret' + +#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Butto' + +'n'#7#8'mbMiddle'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Com' + +'mand'#2#10#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#6's' + +'sCtrl'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#6'ssCtrl'#0#6'Button'#7#6'mbLe' + +'ft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2#11#9'Mo' + +'veCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#15'MouseSelActions'#14#1#5'Shi' + +'ft'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingl' + +'e'#8'ClickDir'#7#6'cdDown'#7'Command'#2#9#9'MoveCaret'#8#6'Option'#2#0#8'Pr' + +'iority'#2#0#0#0#13'Lines.Strings'#1#6#12'program new;'#6#5'begin'#6#4'end.' + +#0#21'BracketHighlightStyle'#7#8'sbhsBoth'#0#18'TSynGutterPartList'#0#0#15'T' + +'SynGutterMarks'#0#5'Width'#2#23#0#0#20'TSynGutterLineNumber'#0#5'Width'#2#21 + +#12'MouseActions'#14#0#21'MarkupInfo.Background'#7#9'clBtnFace'#21'MarkupInf' + +'o.Foreground'#7#6'clNone'#10'DigitCount'#2#2#30'ShowOnlyLineNumbersMultiple' + +'sOf'#2#1#9'ZeroStart'#8#12'LeadingZeros'#8#0#0#17'TSynGutterChanges'#0#5'Wi' + +'dth'#2#4#13'ModifiedColor'#4#252#233#0#0#10'SavedColor'#7#7'clGreen'#0#0#19 + +'TSynGutterSeparator'#0#5'Width'#2#2#0#0#21'TSynGutterCodeFolding'#0#12'Mous' + +'eActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10'Cl' + +'ickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2#16#9'MoveCaret'#8 + +#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#7'ssShift'#0 + ,#6'Button'#7#8'mbMiddle'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7 + +'Command'#2#14#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#7 + +'ssShift'#0#9'ShiftMask'#11#7'ssShift'#0#6'Button'#7#8'mbMiddle'#10'ClickCou' + +'nt'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'MoveCaret'#8#6'Opt' + +'ion'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6 + +'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#0#9 + +'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#21'MarkupInfo.Background'#7#6 + +'clNone'#21'MarkupInfo.Foreground'#7#6'clGray'#20'MouseActionsExpanded'#14#1 + +#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'cc' + +'Any'#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'MoveCaret'#8#6'Option'#2#0#8 + +'Priority'#2#0#0#0#21'MouseActionsCollapsed'#14#1#5'Shift'#11#6'ssCtrl'#0#9 + +'ShiftMask'#11#6'ssCtrl'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8 + +'ClickDir'#7#6'cdDown'#7'Command'#2#15#9'MoveCaret'#8#6'Option'#2#0#8'Priori' + +'ty'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#6'ssCtrl'#0#6'Button'#7#6'mbLeft' + +#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#15#9'MoveCar' + +'et'#8#6'Option'#2#1#8'Priority'#2#0#0#0#0#0#0#0#8'TSynMemo'#8'SynMemo1'#6'C' + +'ursor'#7#7'crIBeam'#4'Left'#2#20#6'Height'#2'}'#3'Top'#3#131#1#5'Width'#3 + +#142#2#11'Font.Height'#2#243#9'Font.Name'#6#11'Courier New'#10'Font.Pitch'#7 + +#7'fpFixed'#12'Font.Quality'#7#16'fqNonAntialiased'#11'ParentColor'#8#10'Par' + +'entFont'#8#8'TabOrder'#2#2#24'BookMarkOptions.OnChange'#13#12'Gutter.Width' + +#2'='#19'Gutter.MouseActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button' + +#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2 + +#13#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMa' + +'sk'#11#0#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4 + +'cdUp'#7'Command'#2#12#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#10'K' + +'eystrokes'#14#1#7'Command'#7#4'ecUp'#8'ShortCut'#2'&'#0#1#7'Command'#7#7'ec' + +'SelUp'#8'ShortCut'#3'& '#0#1#7'Command'#7#10'ecScrollUp'#8'ShortCut'#3'&@'#0 + +#1#7'Command'#7#6'ecDown'#8'ShortCut'#2'('#0#1#7'Command'#7#9'ecSelDown'#8'S' + +'hortCut'#3'( '#0#1#7'Command'#7#12'ecScrollDown'#8'ShortCut'#3'(@'#0#1#7'Co' + +'mmand'#7#6'ecLeft'#8'ShortCut'#2'%'#0#1#7'Command'#7#9'ecSelLeft'#8'ShortCu' + +'t'#3'% '#0#1#7'Command'#7#10'ecWordLeft'#8'ShortCut'#3'%@'#0#1#7'Command'#7 +#13'ecSelWordLeft'#8'ShortCut'#3'%`'#0#1#7'Command'#7#7'ecRight'#8'ShortCut' +#2''''#0#1#7'Command'#7#10'ecSelRight'#8'ShortCut'#3''' '#0#1#7'Command'#7#11 +'ecWordRight'#8'ShortCut'#3'''@'#0#1#7'Command'#7#14'ecSelWordRight'#8'Short' @@ -55,7 +193,7 @@ LazarusResources.Add('TForm1','FORMDATA',[ +'Command'#7#13'ecGotoMarker0'#8'ShortCut'#3'0@'#0#1#7'Command'#7#13'ecGotoMa' +'rker1'#8'ShortCut'#3'1@'#0#1#7'Command'#7#13'ecGotoMarker2'#8'ShortCut'#3'2' +'@'#0#1#7'Command'#7#13'ecGotoMarker3'#8'ShortCut'#3'3@'#0#1#7'Command'#7#13 - +'ecGotoMarker4'#8'ShortCut'#3'4@'#0#1#7'Command'#7#13'ecGotoMarker5'#8'Short' + ,'ecGotoMarker4'#8'ShortCut'#3'4@'#0#1#7'Command'#7#13'ecGotoMarker5'#8'Short' +'Cut'#3'5@'#0#1#7'Command'#7#13'ecGotoMarker6'#8'ShortCut'#3'6@'#0#1#7'Comma' +'nd'#7#13'ecGotoMarker7'#8'ShortCut'#3'7@'#0#1#7'Command'#7#13'ecGotoMarker8' +#8'ShortCut'#3'8@'#0#1#7'Command'#7#13'ecGotoMarker9'#8'ShortCut'#3'9@'#0#1#7 @@ -65,7 +203,7 @@ LazarusResources.Add('TForm1','FORMDATA',[ +'Marker4'#8'ShortCut'#3'4`'#0#1#7'Command'#7#12'ecSetMarker5'#8'ShortCut'#3 +'5`'#0#1#7'Command'#7#12'ecSetMarker6'#8'ShortCut'#3'6`'#0#1#7'Command'#7#12 +'ecSetMarker7'#8'ShortCut'#3'7`'#0#1#7'Command'#7#12'ecSetMarker8'#8'ShortCu' - ,'t'#3'8`'#0#1#7'Command'#7#12'ecSetMarker9'#8'ShortCut'#3'9`'#0#1#7'Command' + +'t'#3'8`'#0#1#7'Command'#7#12'ecSetMarker9'#8'ShortCut'#3'9`'#0#1#7'Command' +#7#12'EcFoldLevel1'#8'ShortCut'#4'1'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel' +'2'#8'ShortCut'#4'2'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4 +'3'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'4'#160#0#0#0#1#7 @@ -117,170 +255,33 @@ LazarusResources.Add('TForm1','FORMDATA',[ +'ckDir'#7#4'cdUp'#7'Command'#2#11#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2 +#0#0#0#15'MouseSelActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6 +'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#9 - +#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#13'Lines.Strings'#1#6#12'p' - +'rogram new;'#6#5'begin'#6#4'end.'#0#21'BracketHighlightStyle'#7#8'sbhsBoth' - +#0#18'TSynGutterPartList'#0#0#15'TSynGutterMarks'#0#5'Width'#2#23#0#0#20'TSy' - +'nGutterLineNumber'#0#5'Width'#2#21#12'MouseActions'#14#0#21'MarkupInfo.Back' - +'ground'#7#9'clBtnFace'#21'MarkupInfo.Foreground'#7#6'clNone'#10'DigitCount' - +#2#2#30'ShowOnlyLineNumbersMultiplesOf'#2#1#9'ZeroStart'#8#12'LeadingZeros'#8 - +#0#0#17'TSynGutterChanges'#0#5'Width'#2#4#13'ModifiedColor'#4#252#233#0#0#10 - +'SavedColor'#7#7'clGreen'#0#0#19'TSynGutterSeparator'#0#5'Width'#2#2#0#0#21 - +'TSynGutterCodeFolding'#0#12'MouseActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11 - +#0#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp' - +#7'Command'#2#16#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11 - +#0#9'ShiftMask'#11#7'ssShift'#0#6'Button'#7#8'mbMiddle'#10'ClickCount'#7#5'c' - ,'cAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'MoveCaret'#8#6'Option'#2#0#8 - +'Priority'#2#0#0#1#5'Shift'#11#7'ssShift'#0#9'ShiftMask'#11#7'ssShift'#0#6'B' - +'utton'#7#8'mbMiddle'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Co' - +'mmand'#2#14#9'MoveCaret'#8#6'Option'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#0#9 - +'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir' - +#7#6'cdDown'#7'Command'#2#0#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0 - +#21'MarkupInfo.Background'#7#6'clNone'#21'MarkupInfo.Foreground'#7#6'clGray' - +#20'MouseActionsExpanded'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6 - +'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9 - +'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#21'MouseActionsCollapsed'#14 - +#1#5'Shift'#11#6'ssCtrl'#0#9'ShiftMask'#11#6'ssCtrl'#0#6'Button'#7#6'mbLeft' + +#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#13'Lines.Strings'#1#6#8'Sy' + +'nMemo1'#0#8'OnChange'#7#14'SynMemo1Change'#0#18'TSynGutterPartList'#0#0#15 + ,'TSynGutterMarks'#0#5'Width'#2#23#0#0#20'TSynGutterLineNumber'#0#5'Width'#2 + +#21#12'MouseActions'#14#0#21'MarkupInfo.Background'#7#9'clBtnFace'#21'Markup' + +'Info.Foreground'#7#6'clNone'#10'DigitCount'#2#2#30'ShowOnlyLineNumbersMulti' + +'plesOf'#2#1#9'ZeroStart'#8#12'LeadingZeros'#8#0#0#17'TSynGutterChanges'#0#5 + +'Width'#2#4#13'ModifiedColor'#4#252#233#0#0#10'SavedColor'#7#7'clGreen'#0#0 + +#19'TSynGutterSeparator'#0#5'Width'#2#2#0#0#21'TSynGutterCodeFolding'#0#12'M' + +'ouseActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10 + +'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2#16#9'MoveCaret' + +#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#7'ssShift' + +#0#6'Button'#7#8'mbMiddle'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown' + +#7'Command'#2#14#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11 + +#7'ssShift'#0#9'ShiftMask'#11#7'ssShift'#0#6'Button'#7#8'mbMiddle'#10'ClickC' + +'ount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'MoveCaret'#8#6'O' + +'ption'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6 + +'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#0#9 + +'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#21'MarkupInfo.Background'#7#6 + +'clNone'#21'MarkupInfo.Foreground'#7#6'clGray'#20'MouseActionsExpanded'#14#1 + +#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'cc' + +'Any'#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'MoveCaret'#8#6'Option'#2#0#8 + +'Priority'#2#0#0#0#21'MouseActionsCollapsed'#14#1#5'Shift'#11#6'ssCtrl'#0#9 + +'ShiftMask'#11#6'ssCtrl'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8 + +'ClickDir'#7#6'cdDown'#7'Command'#2#15#9'MoveCaret'#8#6'Option'#2#0#8'Priori' + +'ty'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#6'ssCtrl'#0#6'Button'#7#6'mbLeft' +#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#15#9'MoveCar' - +'et'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#6'ssC' - +'trl'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDo' - +'wn'#7'Command'#2#15#9'MoveCaret'#8#6'Option'#2#1#8'Priority'#2#0#0#0#0#0#0#0 - +#8'TSynMemo'#8'SynMemo1'#6'Cursor'#7#7'crIBeam'#4'Left'#2#20#6'Height'#2'}'#3 - +'Top'#3#131#1#5'Width'#3#142#2#11'Font.Height'#2#243#9'Font.Name'#6#11'Couri' - +'er New'#10'Font.Pitch'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNonAntialiased' - +#11'ParentColor'#8#10'ParentFont'#8#8'TabOrder'#2#2#12'Gutter.Width'#2'='#19 - +'Gutter.MouseActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbL' - +'eft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#13#9'Mo' - +'veCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0 - +#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7 - +'Command'#2#12#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#10'Keystroke' - +'s'#14#1#7'Command'#7#4'ecUp'#8'ShortCut'#2'&'#0#1#7'Command'#7#7'ecSelUp'#8 - +'ShortCut'#3'& '#0#1#7'Command'#7#10'ecScrollUp'#8'ShortCut'#3'&@'#0#1#7'Com' - +'mand'#7#6'ecDown'#8'ShortCut'#2'('#0#1#7'Command'#7#9'ecSelDown'#8'ShortCut' - +#3'( '#0#1#7'Command'#7#12'ecScrollDown'#8'ShortCut'#3'(@'#0#1#7'Command'#7#6 - +'ecLeft'#8'ShortCut'#2'%'#0#1#7'Command'#7#9'ecSelLeft'#8'ShortCut'#3'% '#0#1 - +#7'Command'#7#10'ecWordLeft'#8'ShortCut'#3'%@'#0#1#7'Command'#7#13'ecSelWord' - +'Left'#8'ShortCut'#3'%`'#0#1#7'Command'#7#7'ecRight'#8'ShortCut'#2''''#0#1#7 - +'Command'#7#10'ecSelRight'#8'ShortCut'#3''' '#0#1#7'Command'#7#11'ecWordRigh' - +'t'#8'ShortCut'#3'''@'#0#1#7'Command'#7#14'ecSelWordRight'#8'ShortCut'#3'''`' - +#0#1#7'Command'#7#10'ecPageDown'#8'ShortCut'#2'"'#0#1#7'Command'#7#13'ecSelP' - +'ageDown'#8'ShortCut'#3'" '#0#1#7'Command'#7#12'ecPageBottom'#8'ShortCut'#3 - +'"@'#0#1#7'Command'#7#15'ecSelPageBottom'#8'ShortCut'#3'"`'#0#1#7'Command'#7 - +#8'ecPageUp'#8'ShortCut'#2'!'#0#1#7'Command'#7#11'ecSelPageUp'#8'ShortCut'#3 - +'! '#0#1#7'Command'#7#9'ecPageTop'#8'ShortCut'#3'!@'#0#1#7'Command'#7#12'ecS' - +'elPageTop'#8'ShortCut'#3'!`'#0#1#7'Command'#7#11'ecLineStart'#8'ShortCut'#2 - +'$'#0#1#7'Command'#7#14'ecSelLineStart'#8'ShortCut'#3'$ '#0#1#7'Command'#7#11 - +'ecEditorTop'#8'ShortCut'#3'$@'#0#1#7'Command'#7#14'ecSelEditorTop'#8'ShortC' - +'ut'#3'$`'#0#1#7'Command'#7#9'ecLineEnd'#8'ShortCut'#2'#'#0#1#7'Command'#7#12 - +'ecSelLineEnd'#8'ShortCut'#3'# '#0#1#7'Command'#7#14'ecEditorBottom'#8'Short' - +'Cut'#3'#@'#0#1#7'Command'#7#17'ecSelEditorBottom'#8'ShortCut'#3'#`'#0#1#7'C' - +'ommand'#7#12'ecToggleMode'#8'ShortCut'#2'-'#0#1#7'Command'#7#6'ecCopy'#8'Sh' - +'ortCut'#3'-@'#0#1#7'Command'#7#7'ecPaste'#8'ShortCut'#3'- '#0#1#7'Command'#7 - +#12'ecDeleteChar'#8'ShortCut'#2'.'#0#1#7'Command'#7#5'ecCut'#8'ShortCut'#3'.' - +' '#0#1#7'Command'#7#16'ecDeleteLastChar'#8'ShortCut'#2#8#0#1#7'Command'#7#16 - +'ecDeleteLastChar'#8'ShortCut'#3#8' '#0#1#7'Command'#7#16'ecDeleteLastWord'#8 - +'ShortCut'#3#8'@'#0#1#7'Command'#7#6'ecUndo'#8'ShortCut'#4#8#128#0#0#0#1#7'C' - +'ommand'#7#6'ecRedo'#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#7#11'ecLineBreak' - +#8'ShortCut'#2#13#0#1#7'Command'#7#11'ecSelectAll'#8'ShortCut'#3'A@'#0#1#7'C' - +'ommand'#7#6'ecCopy'#8'ShortCut'#3'C@'#0#1#7'Command'#7#13'ecBlockIndent'#8 - +'ShortCut'#3'I`'#0#1#7'Command'#7#11'ecLineBreak'#8'ShortCut'#3'M@'#0#1#7'Co' - +'mmand'#7#12'ecInsertLine'#8'ShortCut'#3'N@'#0#1#7'Command'#7#12'ecDeleteWor' - +'d'#8'ShortCut'#3'T@'#0#1#7'Command'#7#15'ecBlockUnindent'#8'ShortCut'#3'U`' - +#0#1#7'Command'#7#7'ecPaste'#8'ShortCut'#3'V@'#0#1#7'Command'#7#5'ecCut'#8'S' - +'hortCut'#3'X@'#0#1#7'Command'#7#12'ecDeleteLine'#8'ShortCut'#3'Y@'#0#1#7'Co' - +'mmand'#7#11'ecDeleteEOL'#8'ShortCut'#3'Y`'#0#1#7'Command'#7#6'ecUndo'#8'Sho' - +'rtCut'#3'Z@'#0#1#7'Command'#7#6'ecRedo'#8'ShortCut'#3'Z`'#0#1#7'Command'#7 - +#13'ecGotoMarker0'#8'ShortCut'#3'0@'#0#1#7'Command'#7#13'ecGotoMarker1'#8'Sh' - +'ortCut'#3'1@'#0#1#7'Command'#7#13'ecGotoMarker2'#8'ShortCut'#3'2@'#0#1#7'Co' - +'mmand'#7#13'ecGotoMarker3'#8'ShortCut'#3'3@'#0#1#7'Command'#7#13'ecGotoMark' - +'er4'#8'ShortCut'#3'4@'#0#1#7'Command'#7#13'ecGotoMarker5'#8'ShortCut'#3'5@' - ,#0#1#7'Command'#7#13'ecGotoMarker6'#8'ShortCut'#3'6@'#0#1#7'Command'#7#13'ec' - +'GotoMarker7'#8'ShortCut'#3'7@'#0#1#7'Command'#7#13'ecGotoMarker8'#8'ShortCu' - +'t'#3'8@'#0#1#7'Command'#7#13'ecGotoMarker9'#8'ShortCut'#3'9@'#0#1#7'Command' - +#7#12'ecSetMarker0'#8'ShortCut'#3'0`'#0#1#7'Command'#7#12'ecSetMarker1'#8'Sh' - +'ortCut'#3'1`'#0#1#7'Command'#7#12'ecSetMarker2'#8'ShortCut'#3'2`'#0#1#7'Com' - +'mand'#7#12'ecSetMarker3'#8'ShortCut'#3'3`'#0#1#7'Command'#7#12'ecSetMarker4' - +#8'ShortCut'#3'4`'#0#1#7'Command'#7#12'ecSetMarker5'#8'ShortCut'#3'5`'#0#1#7 - +'Command'#7#12'ecSetMarker6'#8'ShortCut'#3'6`'#0#1#7'Command'#7#12'ecSetMark' - +'er7'#8'ShortCut'#3'7`'#0#1#7'Command'#7#12'ecSetMarker8'#8'ShortCut'#3'8`'#0 - +#1#7'Command'#7#12'ecSetMarker9'#8'ShortCut'#3'9`'#0#1#7'Command'#7#12'EcFol' - +'dLevel1'#8'ShortCut'#4'1'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel2'#8'Short' - +'Cut'#4'2'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'3'#160#0#0 - +#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'4'#160#0#0#0#1#7'Command'#7 - +#12'EcFoldLevel1'#8'ShortCut'#4'5'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel6' - +#8'ShortCut'#4'6'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel7'#8'ShortCut'#4'7' - +#160#0#0#0#1#7'Command'#7#12'EcFoldLevel8'#8'ShortCut'#4'8'#160#0#0#0#1#7'Co' - +'mmand'#7#12'EcFoldLevel9'#8'ShortCut'#4'9'#160#0#0#0#1#7'Command'#7#12'EcFo' - +'ldLevel0'#8'ShortCut'#4'0'#160#0#0#0#1#7'Command'#7#13'EcFoldCurrent'#8'Sho' - +'rtCut'#4'-'#160#0#0#0#1#7'Command'#7#15'EcUnFoldCurrent'#8'ShortCut'#4'+' - +#160#0#0#0#1#7'Command'#7#18'EcToggleMarkupWord'#8'ShortCut'#4'M'#128#0#0#0#1 - +#7'Command'#7#14'ecNormalSelect'#8'ShortCut'#3'N`'#0#1#7'Command'#7#14'ecCol' - +'umnSelect'#8'ShortCut'#3'C`'#0#1#7'Command'#7#12'ecLineSelect'#8'ShortCut'#3 - +'L`'#0#1#7'Command'#7#5'ecTab'#8'ShortCut'#2#9#0#1#7'Command'#7#10'ecShiftTa' - +'b'#8'ShortCut'#3#9' '#0#1#7'Command'#7#14'ecMatchBracket'#8'ShortCut'#3'B`' - +#0#1#7'Command'#7#10'ecColSelUp'#8'ShortCut'#4'&'#160#0#0#0#1#7'Command'#7#12 - +'ecColSelDown'#8'ShortCut'#4'('#160#0#0#0#1#7'Command'#7#12'ecColSelLeft'#8 - +'ShortCut'#4'%'#160#0#0#0#1#7'Command'#7#13'ecColSelRight'#8'ShortCut'#4'''' - +#160#0#0#0#1#7'Command'#7#16'ecColSelPageDown'#8'ShortCut'#4'"'#160#0#0#0#1#7 - +'Command'#7#18'ecColSelPageBottom'#8'ShortCut'#4'"'#224#0#0#0#1#7'Command'#7 - +#14'ecColSelPageUp'#8'ShortCut'#4'!'#160#0#0#0#1#7'Command'#7#15'ecColSelPag' - +'eTop'#8'ShortCut'#4'!'#224#0#0#0#1#7'Command'#7#17'ecColSelLineStart'#8'Sho' - +'rtCut'#4'$'#160#0#0#0#1#7'Command'#7#15'ecColSelLineEnd'#8'ShortCut'#4'#' - +#160#0#0#0#1#7'Command'#7#17'ecColSelEditorTop'#8'ShortCut'#4'$'#224#0#0#0#1 - +#7'Command'#7#20'ecColSelEditorBottom'#8'ShortCut'#4'#'#224#0#0#0#0#12'Mouse' - +'Actions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'Button' - +#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command' - +#2#1#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#7'ssShift' - +#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickCount' - +#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#1#9'MoveCaret'#9#6'Optio' - +'n'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#5'ssAlt'#0#9'ShiftMask'#11#7'ssShift' - +#5'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7 - +#6'cdDown'#7'Command'#2#3#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5 - +'Shift'#11#7'ssShift'#5'ssAlt'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'But' - +'ton'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Com' - +'mand'#2#3#9'MoveCaret'#9#6'Option'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#0#9 - +'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'Click' - +'Dir'#7#4'cdUp'#7'Command'#2#12#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0 - +#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8 - +'ccDouble'#8'ClickDir'#7#6'cdDown'#7'Command'#2#6#9'MoveCaret'#9#6'Option'#2 - +#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft' - +#10'ClickCount'#7#8'ccTriple'#8'ClickDir'#7#6'cdDown'#7'Command'#2#7#9'MoveC' - +'aret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6 - +'Button'#7#6'mbLeft'#10'ClickCount'#7#6'ccQuad'#8'ClickDir'#7#6'cdDown'#7'Co' - +'mmand'#2#8#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9 - +'ShiftMask'#11#0#6'Button'#7#8'mbMiddle'#10'ClickCount'#7#8'ccSingle'#8'Clic' - +'kDir'#7#6'cdDown'#7'Command'#2#10#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2 - +#0#0#1#5'Shift'#11#6'ssCtrl'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#6'ssCtrl' - +#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7 - +'Command'#2#11#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#15'MouseSelA' - +'ctions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'Click' - +'Count'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#9#9'MoveCaret'#8#6 - +'Option'#2#0#8'Priority'#2#0#0#0#13'Lines.Strings'#1#6#8'SynMemo1'#0#8'OnCha' - +'nge'#7#14'SynMemo1Change'#0#18'TSynGutterPartList'#0#0#15'TSynGutterMarks'#0 - +#5'Width'#2#23#0#0#20'TSynGutterLineNumber'#0#5'Width'#2#21#12'MouseActions' - ,#14#0#21'MarkupInfo.Background'#7#9'clBtnFace'#21'MarkupInfo.Foreground'#7#6 - +'clNone'#10'DigitCount'#2#2#30'ShowOnlyLineNumbersMultiplesOf'#2#1#9'ZeroSta' - +'rt'#8#12'LeadingZeros'#8#0#0#17'TSynGutterChanges'#0#5'Width'#2#4#13'Modifi' - +'edColor'#4#252#233#0#0#10'SavedColor'#7#7'clGreen'#0#0#19'TSynGutterSeparat' - +'or'#0#5'Width'#2#2#0#0#21'TSynGutterCodeFolding'#0#12'MouseActions'#14#1#5 - +'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccS' - +'ingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2#16#9'MoveCaret'#8#6'Option'#2#0#8 - +'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#7'ssShift'#0#6'Button'#7#8 - +'mbMiddle'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#14 - +#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#7'ssShift'#0#9 - +'ShiftMask'#11#7'ssShift'#0#6'Button'#7#8'mbMiddle'#10'ClickCount'#7#5'ccAny' - +#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'MoveCaret'#8#6'Option'#2#1#8'Prio' - +'rity'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'Clic' - +'kCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#0#9'MoveCaret'#8#6 - +'Option'#2#0#8'Priority'#2#0#0#0#21'MarkupInfo.Background'#7#6'clNone'#21'Ma' - +'rkupInfo.Foreground'#7#6'clGray'#20'MouseActionsExpanded'#14#1#5'Shift'#11#0 - +#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDi' - +'r'#7#6'cdDown'#7'Command'#2#14#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0 - +#0#0#21'MouseActionsCollapsed'#14#1#5'Shift'#11#6'ssCtrl'#0#9'ShiftMask'#11#6 - +'ssCtrl'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'c' - +'dDown'#7'Command'#2#15#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'S' - +'hift'#11#0#9'ShiftMask'#11#6'ssCtrl'#0#6'Button'#7#6'mbLeft'#10'ClickCount' - +#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#15#9'MoveCaret'#8#6'Option' - +#2#1#8'Priority'#2#0#0#0#0#0#0#0#17'TSynFreePascalSyn'#17'SynFreePascalSyn1' - +#7'Enabled'#8#12'CompilerMode'#7#9'pcmObjFPC'#14'NestedComments'#9#4'left'#3 - +#242#1#3'top'#2'Y'#0#0#0 + +'et'#8#6'Option'#2#1#8'Priority'#2#0#0#0#0#0#0#0#17'TSynFreePascalSyn'#17'Sy' + +'nFreePascalSyn1'#7'Enabled'#8#12'CompilerMode'#7#9'pcmObjFPC'#14'NestedComm' + +'ents'#9#4'left'#3#242#1#3'top'#2'Y'#0#0#0 ]); diff --git a/Tests/PS/colourtest.txt b/Tests/PS/colourtest.txt new file mode 100644 index 0000000..8be713c --- /dev/null +++ b/Tests/PS/colourtest.txt @@ -0,0 +1,42 @@ +program new; +var + x,y,w,h,i,j,t,t2:integer; +begin + getclientdimensions(w,h); + writeln(inttostr(w) + ', ' + inttostr(h)); + + + for i := 0 to 2 do + begin + setcolortolerancespeed(i); + t := getsystemtime; + for j := 0 to 100 do + findcolortolerance(x, y, 255, 0, 0, w, h, 40); + t2 := getsystemtime; + writeln('Time for 101 tries: ' + inttostr(t2 - t) + ' ms.'); + writeln('That is ' + FloatToStr((t2 - t) / 101) + ' ms each.'); + + if findcolortolerance(x, y, 255, 0, 0, w, h, 40) then + begin + writeln('CTS: ' + inttostr(I) + '; Found the colour at (' + inttostr(x) + ', ' + + inttostr(y) + ')'); + movemouse(x, y); + wait(1000); + end else + writeln('not found'); + end; +end. + +Compiled succesfully in 7 ms. +826, 597 +Time for 101 tries: 1143 ms. +That is 11.316831683168 ms each. +not found +Time for 101 tries: 2565 ms. +That is 25.396039603960 ms each. +not found +Time for 101 tries: 3799 ms. +That is 37.613861386139 ms each. +not found +Succesfully executed + diff --git a/Units/MMLAddon/PSInc/Wrappers/colour.inc b/Units/MMLAddon/PSInc/Wrappers/colour.inc index 0942eab..c2e3055 100644 --- a/Units/MMLAddon/PSInc/Wrappers/colour.inc +++ b/Units/MMLAddon/PSInc/Wrappers/colour.inc @@ -1,9 +1,14 @@ function findcolor(var x, y: integer; color, x1, y1, x2, y2: integer): boolean; begin - CurrThread.Client.MFinder.FindColor(x, y, color, x1, y1, x2, y2); + Result := CurrThread.Client.MFinder.FindColor(x, y, color, x1, y1, x2, y2); end; -procedure GetClientDimensions(var w, h: integer); +function findcolortolerance(var x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean; begin - CurrThread.Client.MWindow.GetDimensions(w, h); + Result := CurrThread.Client.MFinder.FindColorTolerance(x, y, color, x1, y1, x2, y2, tol); +end; + +procedure SetColorToleranceSpeed(cts: Integer); +begin + CurrThread.Client.MFinder.SetToleranceSpeed(cts); end; diff --git a/Units/MMLAddon/PSInc/Wrappers/mouse.inc b/Units/MMLAddon/PSInc/Wrappers/mouse.inc new file mode 100644 index 0000000..6d95014 --- /dev/null +++ b/Units/MMLAddon/PSInc/Wrappers/mouse.inc @@ -0,0 +1,9 @@ +procedure MoveMouse(x, y: integer); +begin + CurrThread.Client.MInput.SetMousePos(X, Y); +end; + +procedure GetMousePos(var x, y: integer); +begin + CurrThread.Client.MInput.GetMousePos(X, Y); +end; diff --git a/Units/MMLAddon/PSInc/Wrappers/other.inc b/Units/MMLAddon/PSInc/Wrappers/other.inc new file mode 100644 index 0000000..96933d8 --- /dev/null +++ b/Units/MMLAddon/PSInc/Wrappers/other.inc @@ -0,0 +1,10 @@ +procedure GetClientDimensions(var w, h: integer); +begin + CurrThread.Client.MWindow.GetDimensions(w, h); +end; + +procedure Wait(t: Integer); +begin + Sleep(t); +end; + diff --git a/Units/MMLAddon/PSInc/pscompile.inc b/Units/MMLAddon/PSInc/pscompile.inc index ad14a21..f34a968 100644 --- a/Units/MMLAddon/PSInc/pscompile.inc +++ b/Units/MMLAddon/PSInc/pscompile.inc @@ -1,31 +1,43 @@ - -Sender.Comp.AddTypeS('TIntegerArray', 'Array of integer'); -Sender.Comp.AddTypeS('TPointArray','Array of TPoint'); -Sender.AddFunction(@ThreadSafeCall,'function ThreadSafeCall(ProcName: string; var V: TVariantArray): Variant;'); -Sender.AddFunction(@psWriteln,'procedure writeln(s : string);'); -Sender.AddFunction(@FindColor, 'function findcolor(var x, y: integer; color, x1, y1, x2, y2: integer): boolean;'); -Sender.AddFunction(@GetClientDimensions, 'procedure GetClientDimensions(var w, h:integer);'); -Sender.AddFunction(@CreateBitmap,'function CreateBitmap(w,h :integer) : integer;'); -Sender.AddFunction(@FreeBitmap,'procedure FreeBitmap(Bmp : integer);'); -Sender.AddFunction(@SaveBitmap,'procedure SaveBitmap(Bmp : integer; path : string);'); -Sender.AddFunction(@BitmapFromString,'function BitmapFromString(Width,Height : integer; Data : string): integer;'); -Sender.AddFunction(@LoadBitmap,'function LoadBitmap(Path : string) : integer;'); -Sender.AddFunction(@SetBitmapSize,'procedure SetBitmapSize(Bmp,NewW,NewH : integer);'); -Sender.AddFunction(@GetBitmapSize,'procedure GetBitmapSize(Bmp : integer; Var BmpW,BmpH : integer);'); -Sender.AddFunction(@CreateMirroredBitmap,'function CreateMirroredBitmap(Bmp : integer) : integer;'); -Sender.AddFunction(@FastSetPixel,'procedure FastSetPixel(bmp,x,y : integer; Color : TColor);'); -Sender.AddFunction(@FastSetPixels,'procedure FastSetPixels(bmp : integer; TPA : TPointArray; Colors : TIntegerArray);'); -Sender.AddFunction(@FastGetPixel,'function FastGetPixel(bmp, x,y : integer) : TColor;'); -Sender.AddFunction(@FastGetPixels,'function FastGetPixels(Bmp : integer; TPA : TPointArray) : TIntegerArray;'); -Sender.AddFunction(@FastDrawClear,'procedure FastDrawClear(bmp : integer; Color : TColor)'); -Sender.AddFunction(@FastDrawTransparent,'procedure FastDrawTransparent(x, y: Integer; SourceBitmap, TargetBitmap: Integer);'); -Sender.AddFunction(@SetTransparentColor,'procedure SetTransparentColor(bmp : integer; Color : TColor);'); -Sender.AddFunction(@GetTransparentColor,'function GetTransparentColor(bmp: integer) : TColor;'); -Sender.AddFunction(@FastReplaceColor,'procedure FastReplaceColor(Bmp : integer; OldColor,NewColor : TColor);'); - - - - - - - + +Sender.Comp.AddTypeS('TIntegerArray', 'Array of integer'); +Sender.Comp.AddTypeS('TPointArray','Array of TPoint'); + + +Sender.AddFunction(@ThreadSafeCall,'function ThreadSafeCall(ProcName: string; var V: TVariantArray): Variant;'); +Sender.AddFunction(@psWriteln,'procedure writeln(s : string);'); + +Sender.AddFunction(@FindColor, 'function findcolor(var x, y: integer; color, x1, y1, x2, y2: integer): boolean;'); +Sender.AddFunction(@FindColorTolerance, 'function findcolortolerance(var x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean;'); + +Sender.AddFunction(@MoveMouse, 'procedure MoveMouse(x, y: integer);'); +Sender.AddFunction(@GetMousePos, 'procedure GetMousePos(var x, y: integer);'); + +Sender.AddFunction(@Wait, 'procedure wait(t: integer);'); +Sender.AddFunction(@GetClientDimensions, 'procedure GetClientDimensions(var w, h:integer);'); +Sender.AddFunction(@SetColorToleranceSpeed, 'procedure SetColorToleranceSpeed(cts: integer);'); +Sender.AddFunction(@GetTickCount, 'function GetSystemTime: Integer;'); + +Sender.AddFunction(@CreateBitmap,'function CreateBitmap(w,h :integer) : integer;'); +Sender.AddFunction(@FreeBitmap,'procedure FreeBitmap(Bmp : integer);'); +Sender.AddFunction(@SaveBitmap,'procedure SaveBitmap(Bmp : integer; path : string);'); +Sender.AddFunction(@BitmapFromString,'function BitmapFromString(Width,Height : integer; Data : string): integer;'); +Sender.AddFunction(@LoadBitmap,'function LoadBitmap(Path : string) : integer;'); +Sender.AddFunction(@SetBitmapSize,'procedure SetBitmapSize(Bmp,NewW,NewH : integer);'); +Sender.AddFunction(@GetBitmapSize,'procedure GetBitmapSize(Bmp : integer; Var BmpW,BmpH : integer);'); +Sender.AddFunction(@CreateMirroredBitmap,'function CreateMirroredBitmap(Bmp : integer) : integer;'); +Sender.AddFunction(@FastSetPixel,'procedure FastSetPixel(bmp,x,y : integer; Color : TColor);'); +Sender.AddFunction(@FastSetPixels,'procedure FastSetPixels(bmp : integer; TPA : TPointArray; Colors : TIntegerArray);'); +Sender.AddFunction(@FastGetPixel,'function FastGetPixel(bmp, x,y : integer) : TColor;'); +Sender.AddFunction(@FastGetPixels,'function FastGetPixels(Bmp : integer; TPA : TPointArray) : TIntegerArray;'); +Sender.AddFunction(@FastDrawClear,'procedure FastDrawClear(bmp : integer; Color : TColor)'); +Sender.AddFunction(@FastDrawTransparent,'procedure FastDrawTransparent(x, y: Integer; SourceBitmap, TargetBitmap: Integer);'); +Sender.AddFunction(@SetTransparentColor,'procedure SetTransparentColor(bmp : integer; Color : TColor);'); +Sender.AddFunction(@GetTransparentColor,'function GetTransparentColor(bmp: integer) : TColor;'); +Sender.AddFunction(@FastReplaceColor,'procedure FastReplaceColor(Bmp : integer; OldColor,NewColor : TColor);'); + + + + + + + diff --git a/Units/MMLAddon/mmlpsthread.pas b/Units/MMLAddon/mmlpsthread.pas index 4ca1ec8..6f57337 100644 --- a/Units/MMLAddon/mmlpsthread.pas +++ b/Units/MMLAddon/mmlpsthread.pas @@ -1,250 +1,254 @@ -unit mmlpsthread; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, SysUtils, client, uPSComponent,uPSCompiler,uPSRuntime,SynMemo; - -type - - { TMMLPSThread } - - TMMLPSThread = class(TThread) - protected -// PSScript : TPSScript; -// PSClient : TPSScript; -// Client: TClient; -// DebugTo : TStrings; - PSScript : TPSScript; - DebugTo : TSynMemo; - procedure OnCompile(Sender: TPSScript); - procedure AfterExecute(Sender : TPSScript); - function RequireFile(Sender: TObject; const OriginFileName: String; - var FileName, OutPut: string): Boolean; - procedure OnCompImport(Sender: TObject; x: TPSPascalCompiler); - procedure OnExecImport(Sender: TObject; se: TPSExec; x: TPSRuntimeClassImporter); - procedure OutputMessages; - procedure OnThreadTerminate(Sender: TObject); - procedure Execute; override; - public - Client : TClient; - procedure SetPSScript(Script : string); - procedure SetDebug( Strings : TSynMemo ); -// function CompilePSScript : boolean; -// function - constructor Create(CreateSuspended: Boolean); - destructor Destroy; override; - end; - -implementation -uses - MufasaTypes, - {$ifdef mswindows}windows,{$endif} - uPSC_std, uPSC_controls,uPSC_classes,uPSC_graphics,uPSC_stdctrls,uPSC_forms, - uPSC_extctrls, //Compile-libs - - uPSR_std, uPSR_controls,uPSR_classes,uPSR_graphics,uPSR_stdctrls,uPSR_forms, - uPSR_extctrls, //Runtime-libs - Graphics, //For Graphics types - lclintf; // for GetTickCount and others. - - -threadvar - CurrThread : TMMLPSThread; - -{Some General PS Functions here} -procedure psWriteln(str : string); -begin - {$IFNDEF MSWINDOWS} - writeln(str); - {$ELSE} - if CurrThread.DebugTo <> nil then - CurrThread.DebugTo.Lines.Add(Str); - {$ENDIF} - //Just overwriting itz.. soz. -end; - -function ThreadSafeCall(ProcName: string; var V: TVariantArray): Variant; -var - i : integer; -begin; - Writeln('We have a length of: ' + inttostr(length(v))); - Try - Result := CurrThread.PSScript.Exec.RunProcPVar(v,CurrThread.PSScript.Exec.GetProc(Procname)); - Except - Writeln('We has some errors :-('); - end; -end; - -{ - Note to Raymond: For PascalScript, Create it on the .Create, - Execute it on the .Execute, and don't forget to Destroy it on .Destroy. - - Furthermore, all the wrappers can be in the unit "implementation" section. - Better still to create an .inc for it, otherwise this unit will become huge. - (You can even split up the .inc's in stuff like color, bitmap, etc. ) - - Also, don't add PS to this unit, but make a seperate unit for it. - Unit "MMLPSThread", perhaps? - - See the TestUnit for use of this thread, it's pretty straightforward. - - It may also be wise to turn the "Importing of wrappers" into an include as - well, it will really make the unit more straightforward to use and read. -} - - -constructor TMMLPSThread.Create(CreateSuspended : boolean); -begin - Client := TClient.Create; - PSScript := TPSScript.Create(nil); - PSScript.UsePreProcessor:= True; - PSScript.OnNeedFile := @RequireFile; - - PSScript.OnCompile:= @OnCompile; - PSScript.OnCompImport:= @OnCompImport; - PSScript.OnExecImport:= @OnExecImport; - PSScript.OnAfterExecute:= @AfterExecute; - - // Set some defines - {$I PSInc/psdefines.inc} - - - FreeOnTerminate := True; - Self.OnTerminate := @Self.OnThreadTerminate; - inherited Create(CreateSuspended); -end; - -procedure TMMLPSThread.OnThreadTerminate(Sender: TObject); -begin -// Writeln('Terminating the thread'); -end; - -destructor TMMLPSThread.Destroy; -begin - Client.Free; - PSScript.Free; - inherited; -end; - -// include PS wrappers -{$I PSInc/Wrappers/bitmap.inc} -{$I PSInc/Wrappers/colour.inc} - - - - -procedure TMMLPSThread.OnCompile(Sender: TPSScript); -begin - //Here we add all the initalizing, of BMPArray etc - - // ^ This will all be done with Client.Create; - - // Here we add all the functions to the engine. - {$I PSInc/pscompile.inc} -end; - -procedure TMMLPSThread.AfterExecute(Sender: TPSScript); -begin - //Here we add all the Script-freeing-leftovers (like BMParray etc) - // ^ This will all be done with Client.Destroy; -end; - -function TMMLPSThread.RequireFile(Sender: TObject; - const OriginFileName: String; var FileName, OutPut: string): Boolean; -begin - -end; - -procedure TMMLPSThread.OnCompImport(Sender: TObject; x: TPSPascalCompiler); -begin - SIRegister_Std(x); - SIRegister_Controls(x); - SIRegister_Classes(x, true); - SIRegister_Graphics(x, true); - SIRegister_stdctrls(x); - SIRegister_Forms(x); - SIRegister_ExtCtrls(x); -end; - -procedure TMMLPSThread.OnExecImport(Sender: TObject; se: TPSExec; - x: TPSRuntimeClassImporter); -begin - RIRegister_Std(x); - RIRegister_Classes(x, True); - RIRegister_Controls(x); - RIRegister_Graphics(x, True); - RIRegister_stdctrls(x); - RIRegister_Forms(x); - RIRegister_ExtCtrls(x); -end; - -procedure TMMLPSThread.OutputMessages; -var - l: Longint; - b: Boolean; -begin - b := False; - for l := 0 to PSScript.CompilerMessageCount - 1 do - begin - psWriteln(PSScript.CompilerErrorToStr(l)); - if (not b) and (PSScript.CompilerMessages[l] is TIFPSPascalCompilerError) then - begin - b := True; -// FormMain.CurrSynEdit.SelStart := PSScript.CompilerMessages[l].Pos; - - end; - end; -end; - -procedure TMMLPSThread.Execute; -var - time, i, ii: Integer; -begin; - CurrThread := Self; - time := lclintf.GetTickCount; - try - if PSScript.Compile then - begin - OutputMessages; - psWriteln('Compiled succesfully in ' + IntToStr(GetTickCount - time) + ' ms.'); -// if not (ScriptState = SCompiling) then - if not PSScript.Execute then - begin -// FormMain.CurrSynEdit.SelStart := Script.PSScript.ExecErrorPosition; - psWriteln(PSScript.ExecErrorToString +' at '+Inttostr(PSScript.ExecErrorProcNo)+'.' - +Inttostr(PSScript.ExecErrorByteCodePosition)); - end else psWriteln('Succesfully executed'); - end else - begin - OutputMessages; - psWriteln('Compiling failed'); - end; - except - on E : Exception do - psWriteln('Error: ' + E.Message); - end; -end; - -procedure TMMLPSThread.SetPSScript(Script: string); -begin - PSScript.Script.Text:= Script; -end; - -procedure TMMLPSThread.SetDebug(Strings: TSynMemo); -begin - DebugTo := Strings; -end; - - -{ Include stuff here? } - -//{$I inc/colors.inc} -//{$I inc/bitmaps.inc} - - -end. - - +unit mmlpsthread; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, client, uPSComponent,uPSCompiler,uPSRuntime,SynMemo; + +type + + { TMMLPSThread } + + TMMLPSThread = class(TThread) + protected +// PSScript : TPSScript; +// PSClient : TPSScript; +// Client: TClient; +// DebugTo : TStrings; + PSScript : TPSScript; + DebugTo : TSynMemo; + procedure OnCompile(Sender: TPSScript); + procedure AfterExecute(Sender : TPSScript); + function RequireFile(Sender: TObject; const OriginFileName: String; + var FileName, OutPut: string): Boolean; + procedure OnCompImport(Sender: TObject; x: TPSPascalCompiler); + procedure OnExecImport(Sender: TObject; se: TPSExec; x: TPSRuntimeClassImporter); + procedure OutputMessages; + procedure OnThreadTerminate(Sender: TObject); + procedure Execute; override; + public + Client : TClient; + procedure SetPSScript(Script : string); + procedure SetDebug( Strings : TSynMemo ); +// function CompilePSScript : boolean; +// function + constructor Create(CreateSuspended: Boolean); + destructor Destroy; override; + end; + +implementation +uses + MufasaTypes, + {$ifdef mswindows}windows,{$endif} + uPSC_std, uPSC_controls,uPSC_classes,uPSC_graphics,uPSC_stdctrls,uPSC_forms, + uPSC_extctrls, //Compile-libs + + uPSR_std, uPSR_controls,uPSR_classes,uPSR_graphics,uPSR_stdctrls,uPSR_forms, + uPSR_extctrls, //Runtime-libs + Graphics, //For Graphics types + lclintf; // for GetTickCount and others. + + +threadvar + CurrThread : TMMLPSThread; + +{Some General PS Functions here} +procedure psWriteln(str : string); +begin + {$IFNDEF MSWINDOWS} + writeln(str); + {$ELSE} + if CurrThread.DebugTo <> nil then + CurrThread.DebugTo.Lines.Add(Str); + {$ENDIF} + //Just overwriting itz.. soz. +end; + +function ThreadSafeCall(ProcName: string; var V: TVariantArray): Variant; +var + i : integer; +begin; + Writeln('We have a length of: ' + inttostr(length(v))); + Try + Result := CurrThread.PSScript.Exec.RunProcPVar(v,CurrThread.PSScript.Exec.GetProc(Procname)); + Except + Writeln('We has some errors :-('); + end; +end; + + +{ + Note to Raymond: For PascalScript, Create it on the .Create, + Execute it on the .Execute, and don't forget to Destroy it on .Destroy. + + Furthermore, all the wrappers can be in the unit "implementation" section. + Better still to create an .inc for it, otherwise this unit will become huge. + (You can even split up the .inc's in stuff like color, bitmap, etc. ) + + Also, don't add PS to this unit, but make a seperate unit for it. + Unit "MMLPSThread", perhaps? + + See the TestUnit for use of this thread, it's pretty straightforward. + + It may also be wise to turn the "Importing of wrappers" into an include as + well, it will really make the unit more straightforward to use and read. +} + + +constructor TMMLPSThread.Create(CreateSuspended : boolean); +begin + Client := TClient.Create; + + PSScript := TPSScript.Create(nil); + PSScript.UsePreProcessor:= True; + PSScript.OnNeedFile := @RequireFile; + + PSScript.OnCompile:= @OnCompile; + PSScript.OnCompImport:= @OnCompImport; + PSScript.OnExecImport:= @OnExecImport; + PSScript.OnAfterExecute:= @AfterExecute; + + // Set some defines + {$I PSInc/psdefines.inc} + + + FreeOnTerminate := True; + Self.OnTerminate := @Self.OnThreadTerminate; + inherited Create(CreateSuspended); +end; + +procedure TMMLPSThread.OnThreadTerminate(Sender: TObject); +begin +// Writeln('Terminating the thread'); +end; + +destructor TMMLPSThread.Destroy; +begin + Client.Free; + PSScript.Free; + inherited; +end; + +// include PS wrappers +{$I PSInc/Wrappers/other.inc} +{$I PSInc/Wrappers/bitmap.inc} +{$I PSInc/Wrappers/colour.inc} +{$I PSInc/Wrappers/mouse.inc} + + + + +procedure TMMLPSThread.OnCompile(Sender: TPSScript); +begin + //Here we add all the initalizing, of BMPArray etc + + // ^ This will all be done with Client.Create; + + // Here we add all the functions to the engine. + {$I PSInc/pscompile.inc} +end; + +procedure TMMLPSThread.AfterExecute(Sender: TPSScript); +begin + //Here we add all the Script-freeing-leftovers (like BMParray etc) + // ^ This will all be done with Client.Destroy; +end; + +function TMMLPSThread.RequireFile(Sender: TObject; + const OriginFileName: String; var FileName, OutPut: string): Boolean; +begin + +end; + +procedure TMMLPSThread.OnCompImport(Sender: TObject; x: TPSPascalCompiler); +begin + SIRegister_Std(x); + SIRegister_Controls(x); + SIRegister_Classes(x, true); + SIRegister_Graphics(x, true); + SIRegister_stdctrls(x); + SIRegister_Forms(x); + SIRegister_ExtCtrls(x); +end; + +procedure TMMLPSThread.OnExecImport(Sender: TObject; se: TPSExec; + x: TPSRuntimeClassImporter); +begin + RIRegister_Std(x); + RIRegister_Classes(x, True); + RIRegister_Controls(x); + RIRegister_Graphics(x, True); + RIRegister_stdctrls(x); + RIRegister_Forms(x); + RIRegister_ExtCtrls(x); +end; + +procedure TMMLPSThread.OutputMessages; +var + l: Longint; + b: Boolean; +begin + b := False; + for l := 0 to PSScript.CompilerMessageCount - 1 do + begin + psWriteln(PSScript.CompilerErrorToStr(l)); + if (not b) and (PSScript.CompilerMessages[l] is TIFPSPascalCompilerError) then + begin + b := True; +// FormMain.CurrSynEdit.SelStart := PSScript.CompilerMessages[l].Pos; + + end; + end; +end; + +procedure TMMLPSThread.Execute; +var + time, i, ii: Integer; +begin; + CurrThread := Self; + time := lclintf.GetTickCount; + try + if PSScript.Compile then + begin + OutputMessages; + psWriteln('Compiled succesfully in ' + IntToStr(GetTickCount - time) + ' ms.'); +// if not (ScriptState = SCompiling) then + if not PSScript.Execute then + begin +// FormMain.CurrSynEdit.SelStart := Script.PSScript.ExecErrorPosition; + psWriteln(PSScript.ExecErrorToString +' at '+Inttostr(PSScript.ExecErrorProcNo)+'.' + +Inttostr(PSScript.ExecErrorByteCodePosition)); + end else psWriteln('Succesfully executed'); + end else + begin + OutputMessages; + psWriteln('Compiling failed'); + end; + except + on E : Exception do + psWriteln('Error: ' + E.Message); + end; +end; + +procedure TMMLPSThread.SetPSScript(Script: string); +begin + PSScript.Script.Text:= Script; +end; + +procedure TMMLPSThread.SetDebug(Strings: TSynMemo); +begin + DebugTo := Strings; +end; + + +{ Include stuff here? } + +//{$I inc/colors.inc} +//{$I inc/bitmaps.inc} + + +end. + + diff --git a/Units/MMLCore/finder.pas b/Units/MMLCore/finder.pas index f838335..a26b05c 100644 --- a/Units/MMLCore/finder.pas +++ b/Units/MMLCore/finder.pas @@ -1,149 +1,233 @@ -unit finder; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, SysUtils, MufasaTypes; // Types - -{ TMFinder Class } - -{ - Should be 100% independant, as all platform dependant code is in the - Window and Input classes. - - Let's try not to use any OS-specific defines here? ;) -} - -type - TMFinder = class(TObject) - constructor Create(aClient: TObject); - destructor Destroy; override; - private - Procedure UpdateCachedValues(NewWidth,NewHeight : integer); - procedure DefaultOperations(var x1,y1,x2,y2 : integer); - public - // Possibly turn x, y into a TPoint var. - function FindColor(var x, y: Integer; Color, x1, y1, x2, y2: Integer): Boolean; - protected - Client: TObject; - CachedWidth, CachedHeight : integer; - ClientTPA : TPointArray; - //CTS : integer; - - private - - end; - -implementation -uses - Client; // For the Client Casts. - - -constructor TMFinder.Create(aClient: TObject); - -begin - inherited Create; - - Self.Client := aClient; - -end; - -destructor TMFinder.Destroy; -begin - - inherited; -end; - -procedure TMFinder.UpdateCachedValues(NewWidth, NewHeight: integer); -begin - CachedWidth := NewWidth; - CachedHeight := NewHeight; - SetLength(ClientTPA,NewWidth * NewHeight); -end; - -procedure TMFinder.DefaultOperations(var x1, y1, x2, y2: integer); -var - w,h : integer; -begin -{ if x1 > x2 then - Swap(x1,x2); - if y1 > y2 then - Swap(y1,y2);} - if x1 < 0 then - x1 := 0; - if y1 < 0 then - y1 := 0; - TClient(Self.Client).MWindow.GetDimensions(w,h); - if (w <> CachedWidth) or (h <> CachedHeight) then - UpdateCachedValues(w,h); - if x2 >= w then - x2 := w-1; - if y2 >= h then - y2 := h-1; -end; - -function TMFinder.FindColor(var x, y: Integer; Color, x1, y1, x2, y2: Integer): Boolean; -var - PtrData: TRetData; - Ptr: PRGB32; - PtrInc: Integer; - dX, dY, clR, clG, clB, xx, yy: Integer; - -begin - - // checks for valid x1,y1,x2,y2? (may involve GetDimensions) - DefaultOperations(x1,y1,x2,y2); - - // calculate delta x and y - dX := x2 - x1; - dY := y2 - y1; - //next, convert the color to r,g,b - { - ColorToRGB(Color, clR, clG, clB); - } - - PtrData := TClient(Client).MWindow.ReturnData(x1, y1, dX + 1, dY + 1); - - // Do we want to "cache" these vars? - // We will, for now. Easier to type. - Ptr := PtrData.Ptr; - PtrInc := PtrData.IncPtrWith; - -{ for yy := 0 to dY do - begin - for xx := 0 to dX do - begin} -//Since we do an Inc on the Ptr, no need to start with an y:=0 value, unless it's faster ofcourse. - for yy := y1 to y2 do - begin; - for xx := x1 to x2 do - begin; - // Colour comparison here. Possibly with tolerance? ;) - if (Ptr^.R = clR) and (Ptr^.G = clG) and (Ptr^.B = clB) then - begin - { - If we are only looking for one colour, result = true, free data, exit. - - Else, add to the "hit" tpa, and increate the count. - Note to Wizzuop: FindColor doesnt have a TPA, dummy. - } - - Result := True; - x := xx; - y := yy; - - TClient(Client).MWindow.FreeReturnData; - Exit; - end; - Inc(Ptr); - end; - Inc(Ptr, PtrInc) - end; - - TClient(Client).MWindow.FreeReturnData; -end; - -end. - +unit finder; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, MufasaTypes; // Types + +{ TMFinder Class } + +{ + Should be 100% independant, as all platform dependant code is in the + Window and Input classes. + + Let's try not to use any OS-specific defines here? ;) +} + +type + TMFinder = class(TObject) + constructor Create(aClient: TObject); + destructor Destroy; override; + private + Procedure UpdateCachedValues(NewWidth,NewHeight : integer); + procedure DefaultOperations(var x1,y1,x2,y2 : integer); + public + procedure SetToleranceSpeed(nCTS: Integer); + + // Possibly turn x, y into a TPoint var. + function FindColor(var x, y: Integer; Color, x1, y1, x2, y2: Integer): Boolean; + function FindColorTolerance(var x, y: Integer; Color, x1, y1, x2, y2, tol: Integer): Boolean; + protected + Client: TObject; + CachedWidth, CachedHeight : integer; + ClientTPA : TPointArray; + hueMod, satMod: Extended; + CTS: Integer; + + end; + +implementation +uses + Client, // For the Client Casts. + colour_conv // For RGBToColor, etc. + ; + + +constructor TMFinder.Create(aClient: TObject); + +begin + inherited Create; + + Self.Client := aClient; + Self.CTS := 1; + Self.hueMod := 0.2; + Self.satMod := 0.2; + +end; + +destructor TMFinder.Destroy; +begin + + inherited; +end; + +procedure TMFinder.SetToleranceSpeed(nCTS: Integer); +begin + if (CTS < 0) or (CTS > 2) then + cts := 1; + Self.CTS := nCTS; +end; + +procedure TMFinder.UpdateCachedValues(NewWidth, NewHeight: integer); +begin + CachedWidth := NewWidth; + CachedHeight := NewHeight; + SetLength(ClientTPA,NewWidth * NewHeight); +end; + +procedure TMFinder.DefaultOperations(var x1, y1, x2, y2: integer); +var + w,h : integer; +begin +{ if x1 > x2 then + Swap(x1,x2); + if y1 > y2 then + Swap(y1,y2);} + if x1 < 0 then + x1 := 0; + if y1 < 0 then + y1 := 0; + TClient(Self.Client).MWindow.GetDimensions(w,h); + if (w <> CachedWidth) or (h <> CachedHeight) then + UpdateCachedValues(w,h); + if x2 >= w then + x2 := w-1; + if y2 >= h then + y2 := h-1; +end; + +function TMFinder.FindColor(var x, y: Integer; Color, x1, y1, x2, y2: Integer): Boolean; +var + PtrData: TRetData; + Ptr: PRGB32; + PtrInc: Integer; + dX, dY, clR, clG, clB, xx, yy: Integer; + +begin + + // checks for valid x1,y1,x2,y2? (may involve GetDimensions) + DefaultOperations(x1,y1,x2,y2); + + // calculate delta x and y + dX := x2 - x1; + dY := y2 - y1; + + //next, convert the color to r,g,b + ColorToRGB(Color, clR, clG, clB); + + PtrData := TClient(Client).MWindow.ReturnData(x1, y1, dX + 1, dY + 1); + + // Do we want to "cache" these vars? + // We will, for now. Easier to type. + Ptr := PtrData.Ptr; + PtrInc := PtrData.IncPtrWith; + + for yy := y1 to y2 do + begin; + for xx := x1 to x2 do + begin; + // Colour comparison here. Possibly with tolerance? ;) + if (Ptr^.R = clR) and (Ptr^.G = clG) and (Ptr^.B = clB) then + begin + Result := True; + x := xx; + y := yy; + + TClient(Client).MWindow.FreeReturnData; + Exit; + end; + Inc(Ptr); + end; + Inc(Ptr, PtrInc) + end; + + TClient(Client).MWindow.FreeReturnData; +end; + +function TMFinder.FindColorTolerance(var x, y: Integer; Color, x1, y1, x2, y2, tol: Integer): Boolean; +var + PtrData: TRetData; + Ptr: PRGB32; + PtrInc: Integer; + dX, dY, clR, clG, clB, xx, yy: Integer; + H1, S1, L1, H2, S2, L2: Extended; + + label Hit; + label Miss; + +begin + + // checks for valid x1,y1,x2,y2? (may involve GetDimensions) + DefaultOperations(x1,y1,x2,y2); + + // calculate delta x and y + dX := x2 - x1; + dY := y2 - y1; + //next, convert the color to r,g,b + ColorToRGB(Color, clR, clG, clB); + ColorToHSL(Color, H1, S1, L1); + + PtrData := TClient(Client).MWindow.ReturnData(x1, y1, dX + 1, dY + 1); + + // Do we want to "cache" these vars? + // We will, for now. Easier to type. + Ptr := PtrData.Ptr; + PtrInc := PtrData.IncPtrWith; + + case CTS of + 0: + for yy := y1 to y2 do + begin + for xx := x1 to x2 do + begin + if ((abs(clR-Ptr^.R) <= Tol) and (abs(clG-Ptr^.G) <= Tol) and (Abs(clG-Ptr^.B) <= Tol)) then + goto Hit; + end; + Inc(Ptr, PtrInc); + end; + + 1: + for yy := y1 to y2 do + begin + for xx := x1 to x2 do + begin + if (Sqrt(sqr(clR-Ptr^.R) + sqr(clG - Ptr^.G) + sqr(clB - Ptr^.B)) <= Tol) then + goto Hit; + end; + Inc(Ptr, PtrInc); + end; + 2: + begin + for yy := y1 to y2 do + for xx := x1 to x2 do + begin + RGBToHSL(Ptr^.R,Ptr^.G,Ptr^.B,H2,S2,L2); + if ((abs(H1 - H2) <= (hueMod * tol)) and (abs(S1 - S2) <= (satMod * tol)) and (abs(L1 - L2) <= Tol)) then + goto Hit; + end; + Inc(Ptr, PtrInc); + end; + end; + TClient(Client).MWindow.FreeReturnData; + Result := False; + Exit; + + Hit: + Result := True; + x := xx; + y := yy; + + TClient(Client).MWindow.FreeReturnData; + Exit; + + Miss: + Inc(Ptr); + + Result := True; + TClient(Client).MWindow.FreeReturnData; +end; + +end. + diff --git a/Units/MMLCore/window.pas b/Units/MMLCore/window.pas index 792afc4..d5dd794 100644 --- a/Units/MMLCore/window.pas +++ b/Units/MMLCore/window.pas @@ -242,7 +242,7 @@ end; // Also thread bugged function TMWindow.CopyClientToBitmap(xs, ys, xe, ye: integer): TBitmap; var - w,h : Integer; + w,h: Integer; ww, hh: Integer; Raw: TRawImage; Bmp: TBitmap; @@ -251,6 +251,7 @@ var Img: PXImage; {$ENDIF} + begin Self.GetDimensions(w, h); writeln(inttostr(xs) + ', ' + inttostr(ys) + ' : ' + inttostr(xe) + ', ' + @@ -263,6 +264,7 @@ begin exit; end; + case Self.TargetMode Of w_Window: begin