1
0
mirror of https://github.com/moparisthebest/Simba synced 2025-03-03 02:41:54 -05:00

Hopefully I've got the right files in here by now... I'll need to fix some stuff i overwrote/broke in the svn madness...

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@436 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
BenLand100 2010-01-20 20:52:18 +00:00
parent 39e4249670
commit 9cd2a2d876
20 changed files with 1079 additions and 277 deletions

View File

@ -31,3 +31,5 @@ clean:
$(binary):
$(CC) $(flags) $(units) $(lazarusunits) -o$(binary) $(defines) project1.lpr
-Fu/usr/local/share/lazarus/ideintf/units/x86_64-linux/

View File

@ -10,7 +10,7 @@
<TargetFileExt Value=""/>
<Title Value="Simba"/>
<UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="0"/>
<ActiveEditorIndexAtStart Value="1"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
@ -36,7 +36,7 @@
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="282">
<Units Count="285">
<Unit0>
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
@ -137,8 +137,9 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="TestUnit"/>
<CursorPos X="11" Y="42"/>
<TopLine Value="27"/>
<ComponentState Value="1"/>
<CursorPos X="64" Y="1539"/>
<TopLine Value="1532"/>
<EditorIndex Value="0"/>
<UsageCount Value="202"/>
<Loaded Value="True"/>
@ -187,9 +188,11 @@
<Filename Value="../../Units/MMLCore/client.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="Client"/>
<CursorPos X="35" Y="64"/>
<TopLine Value="46"/>
<CursorPos X="47" Y="33"/>
<TopLine Value="16"/>
<EditorIndex Value="3"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="../../Units/MMLCore/mufasatypes.pas"/>
@ -211,9 +214,11 @@
<Filename Value="../../Units/MMLCore/window.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="Window"/>
<CursorPos X="71" Y="29"/>
<TopLine Value="363"/>
<CursorPos X="31" Y="59"/>
<TopLine Value="42"/>
<EditorIndex Value="8"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit23>
<Unit24>
<Filename Value="../../../cogat/Units/CogatUnits/comptypes.pas"/>
@ -232,17 +237,19 @@
<Unit26>
<Filename Value="../../Units/MMLCore/input.pas"/>
<UnitName Value="Input"/>
<CursorPos X="17" Y="286"/>
<TopLine Value="266"/>
<UsageCount Value="85"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="4"/>
<UsageCount Value="88"/>
<Loaded Value="True"/>
</Unit26>
<Unit27>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="finder"/>
<CursorPos X="9" Y="90"/>
<TopLine Value="86"/>
<EditorIndex Value="6"/>
<CursorPos X="10" Y="2000"/>
<TopLine Value="1972"/>
<EditorIndex Value="15"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit27>
@ -344,9 +351,9 @@
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="bitmaps"/>
<CursorPos X="50" Y="119"/>
<TopLine Value="113"/>
<EditorIndex Value="5"/>
<CursorPos X="22" Y="681"/>
<TopLine Value="671"/>
<EditorIndex Value="14"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit42>
@ -359,10 +366,10 @@
</Unit43>
<Unit44>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/colour.inc"/>
<CursorPos X="47" Y="47"/>
<TopLine Value="47"/>
<EditorIndex Value="4"/>
<UsageCount Value="30"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="13"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
</Unit44>
<Unit45>
@ -482,8 +489,8 @@
<IsPartOfProject Value="True"/>
<UnitName Value="colour_conv"/>
<CursorPos X="1" Y="332"/>
<TopLine Value="302"/>
<EditorIndex Value="7"/>
<TopLine Value="290"/>
<EditorIndex Value="16"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit62>
@ -495,10 +502,10 @@
</Unit63>
<Unit64>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/other.inc"/>
<CursorPos X="53" Y="13"/>
<TopLine Value="75"/>
<EditorIndex Value="2"/>
<UsageCount Value="41"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="11"/>
<UsageCount Value="45"/>
<Loaded Value="True"/>
</Unit64>
<Unit65>
@ -599,9 +606,11 @@
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="colourpicker"/>
<CursorPos X="22" Y="228"/>
<TopLine Value="1"/>
<CursorPos X="22" Y="229"/>
<TopLine Value="217"/>
<EditorIndex Value="1"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit79>
<Unit80>
<Filename Value="../../../cogat/Units/CogatUnits/compdragger.pas"/>
@ -624,9 +633,11 @@
<Filename Value="../../Units/MMLAddon/windowselector.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="windowselector"/>
<CursorPos X="54" Y="139"/>
<TopLine Value="116"/>
<CursorPos X="39" Y="99"/>
<TopLine Value="82"/>
<EditorIndex Value="2"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit82>
<Unit83>
<Filename Value="../../../usr/lib64/fpc/2.2.4/source/rtl/objpas/classes/classesh.inc"/>
@ -709,9 +720,11 @@
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ocr"/>
<CursorPos X="73" Y="142"/>
<TopLine Value="142"/>
<CursorPos X="51" Y="474"/>
<TopLine Value="457"/>
<EditorIndex Value="6"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit94>
<Unit95>
<Filename Value="../../Units/PascalScript/uPSR_extctrls.pas"/>
@ -1194,7 +1207,6 @@
<ComponentName Value="ColourHistoryForm"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="colourhistory"/>
<ComponentState Value="1"/>
<CursorPos X="43" Y="16"/>
<TopLine Value="1"/>
<UsageCount Value="200"/>
@ -1586,10 +1598,9 @@
<ComponentName Value="FunctionListFrame"/>
<ResourceBaseClass Value="Frame"/>
<UnitName Value="framefunctionlist"/>
<ComponentState Value="1"/>
<CursorPos X="26" Y="295"/>
<TopLine Value="7"/>
<UsageCount Value="141"/>
<UsageCount Value="147"/>
</Unit223>
<Unit224>
<Filename Value="../../../usr/local/share/lazarus/lcl/comctrls.pp"/>
@ -1644,7 +1655,7 @@
<UnitName Value="simpleanalyzer"/>
<CursorPos X="52" Y="104"/>
<TopLine Value="193"/>
<UsageCount Value="128"/>
<UsageCount Value="134"/>
</Unit231>
<Unit232>
<Filename Value="../../Units/Misc/mPasLex.pas"/>
@ -1704,8 +1715,8 @@
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<CursorPos X="30" Y="109"/>
<TopLine Value="98"/>
<EditorIndex Value="3"/>
<UsageCount Value="19"/>
<EditorIndex Value="12"/>
<UsageCount Value="23"/>
<Loaded Value="True"/>
</Unit240>
<Unit241>
@ -1721,7 +1732,7 @@
<UnitName Value="updater"/>
<CursorPos X="38" Y="211"/>
<TopLine Value="65"/>
<UsageCount Value="101"/>
<UsageCount Value="107"/>
</Unit242>
<Unit243>
<Filename Value="updateform.pas"/>
@ -1731,8 +1742,8 @@
<UnitName Value="updateform"/>
<CursorPos X="111" Y="102"/>
<TopLine Value="81"/>
<EditorIndex Value="1"/>
<UsageCount Value="96"/>
<EditorIndex Value="10"/>
<UsageCount Value="102"/>
<Loaded Value="True"/>
</Unit243>
<Unit244>
@ -1854,7 +1865,7 @@
<UnitName Value="simbasettings"/>
<CursorPos X="26" Y="9"/>
<TopLine Value="11"/>
<UsageCount Value="59"/>
<UsageCount Value="65"/>
</Unit261>
<Unit262>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
@ -1897,10 +1908,9 @@
<ComponentName Value="FormReportBug"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="reportbug"/>
<ComponentState Value="1"/>
<CursorPos X="53" Y="23"/>
<TopLine Value="21"/>
<UsageCount Value="42"/>
<UsageCount Value="48"/>
</Unit267>
<Unit268>
<Filename Value="../../Units/Synapse/synsock.pas"/>
@ -1957,7 +1967,7 @@
<UnitName Value="newinternets"/>
<CursorPos X="80" Y="2"/>
<TopLine Value="1"/>
<UsageCount Value="38"/>
<UsageCount Value="44"/>
</Unit275>
<Unit276>
<Filename Value="reportbug.lrs"/>
@ -2000,127 +2010,154 @@
<TopLine Value="511"/>
<UsageCount Value="15"/>
</Unit281>
<Unit282>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<UnitName Value="IOManager"/>
<CursorPos X="84" Y="329"/>
<TopLine Value="318"/>
<EditorIndex Value="5"/>
<UsageCount Value="14"/>
<Loaded Value="True"/>
</Unit282>
<Unit283>
<Filename Value="../../Units/MMLCore/os_linux.pas"/>
<UnitName Value="os_linux"/>
<CursorPos X="1" Y="141"/>
<TopLine Value="124"/>
<EditorIndex Value="7"/>
<UsageCount Value="14"/>
<Loaded Value="True"/>
</Unit283>
<Unit284>
<Filename Value="../../../../custom-installs/freepascal/rtl/unix/mouse.pp"/>
<UnitName Value="Mouse"/>
<CursorPos X="21" Y="30"/>
<TopLine Value="12"/>
<EditorIndex Value="9"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit284>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="testunit.pas"/>
<Caret Line="205" Column="33" TopLine="28"/>
<Caret Line="1275" Column="21" TopLine="1258"/>
</Position1>
<Position2>
<Filename Value="testunit.pas"/>
<Caret Line="196" Column="74" TopLine="45"/>
<Caret Line="579" Column="45" TopLine="573"/>
</Position2>
<Position3>
<Filename Value="testunit.pas"/>
<Caret Line="195" Column="74" TopLine="170"/>
<Caret Line="1277" Column="11" TopLine="1259"/>
</Position3>
<Position4>
<Filename Value="testunit.pas"/>
<Caret Line="231" Column="15" TopLine="218"/>
<Caret Line="290" Column="11" TopLine="273"/>
</Position4>
<Position5>
<Filename Value="testunit.pas"/>
<Caret Line="336" Column="24" TopLine="318"/>
<Caret Line="579" Column="62" TopLine="562"/>
</Position5>
<Position6>
<Filename Value="testunit.pas"/>
<Caret Line="474" Column="16" TopLine="459"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="228" Column="22" TopLine="1"/>
</Position6>
<Position7>
<Filename Value="testunit.pas"/>
<Caret Line="486" Column="22" TopLine="459"/>
<Filename Value="../../Units/MMLAddon/windowselector.pas"/>
<Caret Line="139" Column="54" TopLine="116"/>
</Position7>
<Position8>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="61" Column="25" TopLine="61"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="32" Column="13" TopLine="23"/>
</Position8>
<Position9>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="289" Column="82" TopLine="270"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="49" Column="46" TopLine="32"/>
</Position9>
<Position10>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<Caret Line="114" Column="1" TopLine="103"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="59" Column="26" TopLine="42"/>
</Position10>
<Position11>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<Caret Line="110" Column="27" TopLine="96"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="49" Column="38" TopLine="32"/>
</Position11>
<Position12>
<Filename Value="testunit.pas"/>
<Caret Line="487" Column="95" TopLine="275"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="59" Column="26" TopLine="42"/>
</Position12>
<Position13>
<Filename Value="testunit.pas"/>
<Caret Line="1439" Column="38" TopLine="1407"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="83" Column="1" TopLine="66"/>
</Position13>
<Position14>
<Filename Value="testunit.pas"/>
<Caret Line="1452" Column="33" TopLine="1439"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="85" Column="44" TopLine="68"/>
</Position14>
<Position15>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<Caret Line="115" Column="17" TopLine="80"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="109" Column="24" TopLine="92"/>
</Position15>
<Position16>
<Filename Value="../../Units/MMLCore/colour_conv.pas"/>
<Caret Line="48" Column="1" TopLine="4"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="283" Column="15" TopLine="129"/>
</Position16>
<Position17>
<Filename Value="../../Units/MMLCore/colour_conv.pas"/>
<Caret Line="351" Column="52" TopLine="346"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="115" Column="18" TopLine="97"/>
</Position17>
<Position18>
<Filename Value="../../Units/MMLCore/colour_conv.pas"/>
<Caret Line="374" Column="5" TopLine="345"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="118" Column="35" TopLine="101"/>
</Position18>
<Position19>
<Filename Value="../../Units/MMLCore/colour_conv.pas"/>
<Caret Line="364" Column="35" TopLine="345"/>
<Filename Value="../../Units/MMLAddon/windowselector.pas"/>
<Caret Line="32" Column="39" TopLine="23"/>
</Position19>
<Position20>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<Caret Line="119" Column="77" TopLine="80"/>
<Filename Value="../../Units/MMLAddon/windowselector.pas"/>
<Caret Line="196" Column="25" TopLine="86"/>
</Position20>
<Position21>
<Filename Value="testunit.pas"/>
<Caret Line="1449" Column="100" TopLine="1439"/>
<Filename Value="../../Units/MMLAddon/windowselector.pas"/>
<Caret Line="143" Column="25" TopLine="115"/>
</Position21>
<Position22>
<Filename Value="testunit.pas"/>
<Caret Line="1489" Column="3" TopLine="1487"/>
<Caret Line="37" Column="60" TopLine="16"/>
</Position22>
<Position23>
<Filename Value="testunit.pas"/>
<Caret Line="474" Column="10" TopLine="459"/>
<Caret Line="576" Column="53" TopLine="562"/>
</Position23>
<Position24>
<Filename Value="testunit.pas"/>
<Caret Line="434" Column="20" TopLine="391"/>
<Caret Line="1273" Column="85" TopLine="1256"/>
</Position24>
<Position25>
<Filename Value="testunit.pas"/>
<Caret Line="533" Column="40" TopLine="508"/>
<Caret Line="309" Column="12" TopLine="298"/>
</Position25>
<Position26>
<Filename Value="testunit.pas"/>
<Caret Line="568" Column="40" TopLine="1101"/>
<Caret Line="1275" Column="46" TopLine="1257"/>
</Position26>
<Position27>
<Filename Value="testunit.pas"/>
<Caret Line="58" Column="21" TopLine="38"/>
<Caret Line="1548" Column="9" TopLine="1531"/>
</Position27>
<Position28>
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<Caret Line="128" Column="27" TopLine="111"/>
<Filename Value="testunit.pas"/>
<Caret Line="1304" Column="10" TopLine="1287"/>
</Position28>
<Position29>
<Filename Value="testunit.pas"/>
<Caret Line="468" Column="17" TopLine="418"/>
<Caret Line="1548" Column="10" TopLine="1531"/>
</Position29>
<Position30>
<Filename Value="testunit.pas"/>
<Caret Line="1017" Column="63" TopLine="1010"/>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="229" Column="22" TopLine="206"/>
</Position30>
</JumpHistory>
</ProjectOptions>

View File

@ -1,7 +1,7 @@
object Form1: TForm1
Left = 316
Left = 593
Height = 557
Top = 105
Top = 321
Width = 734
ActiveControl = ScriptPanel
Caption = 'THA FUKING SIMBA'
@ -202,7 +202,7 @@ object Form1: TForm1
object StatusBar: TStatusBar
Left = 0
Height = 21
Top = 536
Top = 511
Width = 734
Panels = <
item
@ -220,7 +220,7 @@ object Form1: TForm1
object PanelMemo: TPanel
Left = 0
Height = 154
Top = 382
Top = 357
Width = 734
Align = alBottom
ClientHeight = 154
@ -240,19 +240,19 @@ object Form1: TForm1
Cursor = crVSplit
Left = 0
Height = 5
Top = 377
Top = 352
Width = 734
Align = alBottom
ResizeAnchor = akBottom
end
object ScriptPanel: TPanel
Left = 0
Height = 353
Height = 328
Top = 24
Width = 734
Align = alClient
BevelOuter = bvNone
ClientHeight = 353
ClientHeight = 328
ClientWidth = 734
DockSite = True
TabOrder = 4
@ -260,7 +260,7 @@ object Form1: TForm1
OnDockOver = ScriptPanelDockOver
object PageControl1: TPageControl
Left = 155
Height = 318
Height = 293
Top = 0
Width = 579
Align = alClient
@ -279,7 +279,7 @@ object Form1: TForm1
object SearchPanel: TPanel
Left = 0
Height = 35
Top = 318
Top = 293
Width = 734
Align = alBottom
BevelOuter = bvSpace
@ -409,21 +409,21 @@ object Form1: TForm1
end
object SplitterFunctionList: TSplitter
Left = 150
Height = 318
Height = 293
Top = 0
Width = 5
OnCanResize = SplitterFunctionListCanResize
Visible = False
end
inline frmFunctionList: TFunctionListFrame
Height = 318
Height = 293
Width = 150
ClientHeight = 318
ClientHeight = 293
ClientWidth = 150
OnEndDock = nil
TabOrder = 3
inherited FunctionList: TTreeView
Height = 269
Height = 244
Top = 22
Width = 150
DefaultItemHeight = 19
@ -434,7 +434,7 @@ object Form1: TForm1
end
inherited editSearchList: TEdit
Height = 27
Top = 291
Top = 266
Width = 150
OnExit = editSearchListExit
OnKeyDown = editSearchListKeyDown

View File

@ -1,22 +1,22 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TForm1','FORMDATA',[
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'<'#1#6'Height'#3'-'#2#3'Top'#2'i'#5'Width'
+#3#222#2#13'ActiveControl'#7#11'ScriptPanel'#7'Caption'#6#16'THA FUKING SIMB'
+'A'#12'ClientHeight'#3#20#2#11'ClientWidth'#3#222#2#10'KeyPreview'#9#4'Menu'
+#7#8'MainMenu'#7'OnClose'#7#9'FormClose'#8'OnCreate'#7#10'FormCreate'#9'OnDe'
+'stroy'#7#11'FormDestroy'#10'OnShortCut'#7#13'FormShortCuts'#8'Position'#7#14
+'poScreenCenter'#10'LCLVersion'#6#6'0.9.29'#7'Visible'#9#0#8'TToolBar'#8'Too'
+'lBar1'#4'Left'#2#0#6'Height'#2#24#3'Top'#2#0#5'Width'#3#222#2#7'Caption'#6#8
+'ToolBar1'#6'Images'#7#17'Mufasa_Image_List'#14'ParentShowHint'#8#8'ShowHint'
+#9#8'TabOrder'#2#0#0#11'TToolButton'#6'TB_Run'#4'Left'#3#168#0#4'Hint'#6#3'R'
+'un'#3'Top'#2#2#6'Action'#7#15'ActionRunScript'#10'ImageIndex'#2#6#0#0#11'TT'
+'oolButton'#8'TB_Pause'#4'Left'#3#191#0#4'Hint'#6#5'Pause'#3'Top'#2#2#6'Acti'
+'on'#7#17'ActionPauseScript'#7'Enabled'#8#10'ImageIndex'#2#5#0#0#11'TToolBut'
+'ton'#7'TB_Stop'#4'Left'#3#214#0#4'Hint'#6#4'Stop'#3'Top'#2#2#6'Action'#7#16
+'ActionStopScript'#7'Enabled'#8#10'ImageIndex'#2#7#0#0#11'TToolButton'#11'To'
+'olButton1'#4'Left'#3#237#0#3'Top'#2#2#5'Width'#2#3#7'Caption'#6#11'ToolButt'
+'on1'#5'Style'#7#10'tbsDivider'#0#0#11'TToolButton'#9'TB_NewTab'#4'Left'#3
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'Q'#2#6'Height'#3'-'#2#3'Top'#3'A'#1#5'Wid'
+'th'#3#222#2#13'ActiveControl'#7#11'ScriptPanel'#7'Caption'#6#16'THA FUKING '
+'SIMBA'#12'ClientHeight'#3#20#2#11'ClientWidth'#3#222#2#10'KeyPreview'#9#4'M'
+'enu'#7#8'MainMenu'#7'OnClose'#7#9'FormClose'#8'OnCreate'#7#10'FormCreate'#9
+'OnDestroy'#7#11'FormDestroy'#10'OnShortCut'#7#13'FormShortCuts'#8'Position'
+#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.29'#7'Visible'#9#0#8'TToolBar'#8
+'ToolBar1'#4'Left'#2#0#6'Height'#2#24#3'Top'#2#0#5'Width'#3#222#2#7'Caption'
+#6#8'ToolBar1'#6'Images'#7#17'Mufasa_Image_List'#14'ParentShowHint'#8#8'Show'
+'Hint'#9#8'TabOrder'#2#0#0#11'TToolButton'#6'TB_Run'#4'Left'#3#168#0#4'Hint'
+#6#3'Run'#3'Top'#2#2#6'Action'#7#15'ActionRunScript'#10'ImageIndex'#2#6#0#0
+#11'TToolButton'#8'TB_Pause'#4'Left'#3#191#0#4'Hint'#6#5'Pause'#3'Top'#2#2#6
+'Action'#7#17'ActionPauseScript'#7'Enabled'#8#10'ImageIndex'#2#5#0#0#11'TToo'
+'lButton'#7'TB_Stop'#4'Left'#3#214#0#4'Hint'#6#4'Stop'#3'Top'#2#2#6'Action'#7
+#16'ActionStopScript'#7'Enabled'#8#10'ImageIndex'#2#7#0#0#11'TToolButton'#11
+'ToolButton1'#4'Left'#3#237#0#3'Top'#2#2#5'Width'#2#3#7'Caption'#6#11'ToolBu'
+'tton1'#5'Style'#7#10'tbsDivider'#0#0#11'TToolButton'#9'TB_NewTab'#4'Left'#3
+#240#0#4'Hint'#6#7'Add tab'#3'Top'#2#2#6'Action'#7#12'ActionNewTab'#0#0#11'T'
+'ToolButton'#11'TB_CloseTab'#4'Left'#3#7#1#4'Hint'#6#9'Close tab'#3'Top'#2#2
+#6'Action'#7#14'ActionCloseTab'#0#0#11'TToolButton'#11'ToolButton4'#4'Left'#3
@ -53,27 +53,27 @@ LazarusResources.Add('TForm1','FORMDATA',[
+'T_Paste'#4'Left'#3#142#0#3'Top'#2#2#6'Action'#7#11'ActionPaste'#0#0#11'TToo'
+'lButton'#11'ToolButton9'#4'Left'#3#165#0#3'Top'#2#2#5'Width'#2#3#7'Caption'
+#6#11'ToolButton9'#5'Style'#7#10'tbsDivider'#0#0#0#10'TStatusBar'#9'StatusBa'
+'r'#4'Left'#2#0#6'Height'#2#21#3'Top'#3#24#2#5'Width'#3#222#2#6'Panels'#14#1
+'r'#4'Left'#2#0#6'Height'#2#21#3'Top'#3#255#1#5'Width'#3#222#2#6'Panels'#14#1
+#5'Width'#2'<'#0#1#4'Text'#6#8'Untitled'#5'Width'#3#150#0#0#1#5'Width'#2'2'#0
+#0#11'SimplePanel'#8#0#0#6'TPanel'#9'PanelMemo'#4'Left'#2#0#6'Height'#3#154#0
+#3'Top'#3'~'#1#5'Width'#3#222#2#5'Align'#7#8'alBottom'#12'ClientHeight'#3#154
+#3'Top'#3'e'#1#5'Width'#3#222#2#5'Align'#7#8'alBottom'#12'ClientHeight'#3#154
+#0#11'ClientWidth'#3#222#2#8'TabOrder'#2#2#0#5'TMemo'#5'Memo1'#4'Left'#2#1#6
+'Height'#3#152#0#3'Top'#2#1#5'Width'#3#220#2#5'Align'#7#8'alClient'#10'Scrol'
+'lBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#0#0#0#9'TSplitter'#19'SplitterMemoS'
+'ynedit'#6'Cursor'#7#8'crVSplit'#4'Left'#2#0#6'Height'#2#5#3'Top'#3'y'#1#5'W'
+'ynedit'#6'Cursor'#7#8'crVSplit'#4'Left'#2#0#6'Height'#2#5#3'Top'#3'`'#1#5'W'
+'idth'#3#222#2#5'Align'#7#8'alBottom'#12'ResizeAnchor'#7#8'akBottom'#0#0#6'T'
+'Panel'#11'ScriptPanel'#4'Left'#2#0#6'Height'#3'a'#1#3'Top'#2#24#5'Width'#3
+'Panel'#11'ScriptPanel'#4'Left'#2#0#6'Height'#3'H'#1#3'Top'#2#24#5'Width'#3
+#222#2#5'Align'#7#8'alClient'#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#3
+'a'#1#11'ClientWidth'#3#222#2#8'DockSite'#9#8'TabOrder'#2#4#10'OnDockDrop'#7
+'H'#1#11'ClientWidth'#3#222#2#8'DockSite'#9#8'TabOrder'#2#4#10'OnDockDrop'#7
,#19'ScriptPanelDockDrop'#10'OnDockOver'#7#19'ScriptPanelDockOver'#0#12'TPage'
+'Control'#12'PageControl1'#4'Left'#3#155#0#6'Height'#3'>'#1#3'Top'#2#0#5'Wid'
+'Control'#12'PageControl1'#4'Left'#3#155#0#6'Height'#3'%'#1#3'Top'#2#0#5'Wid'
+'th'#3'C'#2#5'Align'#7#8'alClient'#6'Images'#7#17'Mufasa_Image_List'#9'Popup'
+'Menu'#7#8'TabPopup'#8'TabOrder'#2#0#8'OnChange'#7#18'PageControl1Change'#10
+'OnChanging'#7#20'PageControl1Changing'#14'OnContextPopup'#7#24'PageControl1'
+'ContextPopup'#10'OnDragDrop'#7#20'PageControl1DragDrop'#10'OnDragOver'#7#20
+'PageControl1DragOver'#11'OnMouseDown'#7#21'PageControl1MouseDown'#9'OnMouse'
+'Up'#7#19'PageControl1MouseUp'#13'OnPageChanged'#7#18'PageControl1Change'#0#0
+#6'TPanel'#11'SearchPanel'#4'Left'#2#0#6'Height'#2'#'#3'Top'#3'>'#1#5'Width'
+#6'TPanel'#11'SearchPanel'#4'Left'#2#0#6'Height'#2'#'#3'Top'#3'%'#1#5'Width'
+#3#222#2#5'Align'#7#8'alBottom'#10'BevelOuter'#7#7'bvSpace'#12'ClientHeight'
+#2'#'#11'ClientWidth'#3#222#2#8'TabOrder'#2#1#7'Visible'#8#0#12'TSpeedButton'
+#17'SpeedButtonSearch'#4'Left'#2' '#6'Height'#2#19#3'Top'#2#7#5'Width'#2#16#5
@ -155,14 +155,14 @@ LazarusResources.Add('TForm1','FORMDATA',[
+#25'LabeledEditSearchKeyPress'#0#0#9'TCheckBox'#17'CheckBoxMatchCase'#4'Left'
+#3'@'#1#6'Height'#2#22#3'Top'#2#7#5'Width'#2'b'#7'Caption'#6#10'Match case'#7
+'OnClick'#7#22'CheckBoxMatchCaseClick'#8'TabOrder'#2#1#0#0#0#9'TSplitter'#20
+'SplitterFunctionList'#4'Left'#3#150#0#6'Height'#3'>'#1#3'Top'#2#0#5'Width'#2
+'SplitterFunctionList'#4'Left'#3#150#0#6'Height'#3'%'#1#3'Top'#2#0#5'Width'#2
+#5#11'OnCanResize'#7#29'SplitterFunctionListCanResize'#7'Visible'#8#0#0#244
+#18'TFunctionListFrame'#15'frmFunctionList'#6'Height'#3'>'#1#5'Width'#3#150#0
+#12'ClientHeight'#3'>'#1#11'ClientWidth'#3#150#0#9'OnEndDock'#13#8'TabOrder'
+#2#3#0#241#9'TTreeView'#12'FunctionList'#6'Height'#3#13#1#3'Top'#2#22#5'Widt'
+'h'#3#150#0#17'DefaultItemHeight'#2#19#8'OnChange'#7#18'FunctionListChange'
+#18'TFunctionListFrame'#15'frmFunctionList'#6'Height'#3'%'#1#5'Width'#3#150#0
+#12'ClientHeight'#3'%'#1#11'ClientWidth'#3#150#0#9'OnEndDock'#13#8'TabOrder'
+#2#3#0#241#9'TTreeView'#12'FunctionList'#6'Height'#3#244#0#3'Top'#2#22#5'Wid'
+'th'#3#150#0#17'DefaultItemHeight'#2#19#8'OnChange'#7#18'FunctionListChange'
+#10'OnDeletion'#13#7'OnEnter'#7#17'FunctionListEnter'#6'OnExit'#7#16'Functio'
+'nListExit'#0#0#241#5'TEdit'#14'editSearchList'#6'Height'#2#27#3'Top'#3'#'#1
+'nListExit'#0#0#241#5'TEdit'#14'editSearchList'#6'Height'#2#27#3'Top'#3#10#1
+#5'Width'#3#150#0#6'OnExit'#7#18'editSearchListExit'#9'OnKeyDown'#7#21'editS'
+'earchListKeyDown'#10'OnKeyPress'#7#22'editSearchListKeyPress'#0#0#241#6'TLa'
+'bel'#17'FunctionListLabel'#6'Height'#2#18#5'Width'#3#146#0#0#0#0#0#9'TMainM'

View File

@ -35,11 +35,12 @@ uses
//Client,
MufasaTypes,
mmlpsthread,synedittypes,
window, // for the comp picker and selector
{$IFDEF MSWINDOWS} os_windows, {$ENDIF} //For ColorPicker etc.
{$IFDEF LINUX} os_linux, {$ENDIF} //For ColorPicker etc.
colourpicker, framescript, windowselector, lcltype, ActnList, StdActns,
SynExportHTML, SynEditKeyCmds, SynEditHighlighter, SynEditMarkupSpecialLine,
SynEditMarkupHighAll, SynEditMiscClasses, LMessages, Buttons, PairSplitter,
ColorBox, about, framefunctionlist, ocr, updateform, simbasettings;
ColorBox , about, framefunctionlist, ocr, updateform, simbasettings;
const
SimbaVersion = 429;
@ -305,7 +306,7 @@ type
CurrScript : TScriptFrame; //The current scriptframe
CurrTab : TMufasaTab; //The current TMufasaTab
Tabs : TList;
Window: TMWindow;
Manager: TIOManager;
OCR_Fonts: TMOCR;
Picker: TMColorPicker;
Selector: TMWindowSelector;
@ -573,9 +574,7 @@ begin
Writeln('Warning: The font directory specified in the Settings isn''t valid. Can''t load fonts now');
ScriptThread.SetPaths(ScriptPath,AppPath,Includepath,PluginsPath,fontPath);
// This doesn't actually set the Client's MWindow to the passed window, it
// only copies the current set window handle.
ScriptThread.Client.MWindow.SetWindow(Self.Window);
ScriptThread.Client.IOManager.SetTarget(Selector.LastPick);
loadFontsOnScriptStart := LoadSettingDef('Settings/Fonts/LoadOnStartUp', 'True');
@ -1271,9 +1270,9 @@ begin
Tabs := TList.Create;
AddTab;//Give it alteast 1 tab ;-).
FunctionListShown(True); //Show this function list bitch!
Window := TMWindow.Create;
Picker := TMColorPicker.Create(Window);
Selector := TMWindowSelector.Create(Window);
Manager := TIOManager.Create(''); //No need to load plugins for the Global manager
Picker := TMColorPicker.Create(Manager);
Selector := TMWindowSelector.Create(Manager);
MainDir:= ExtractFileDir(Application.ExeName);
{ For writeln }
SetLength(DebugStream, 0);
@ -1302,7 +1301,7 @@ begin
Tabs.free;
Selector.Free;
Picker.Free;
Window.Free;
Manager.Free;
PluginsGlob.Free;
SetLength(DebugStream, 0);
@ -1487,7 +1486,7 @@ end;
procedure TForm1.MenuItemReportBugClick(Sender: TObject);
begin
OpenURL('http://old.villavu.com/mantis/bug_report_page.php');
//OpenURL('http://old.villavu.com/mantis/bug_report_page.php');
end;
procedure TForm1.MenuItemShowClick(Sender: TObject);
@ -1546,8 +1545,8 @@ end;
procedure TForm1.ButtonSelectorDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Window.SetTarget(Selector.Drag {$ifdef MSWINDOWS},w_window{$endif});
writeln('New window: ' + IntToStr(Window.{$ifdef MSWindows}TargetHandle{$else}CurWindow{$ENDIF}));
Manager.SetTarget(Selector.Drag {$ifdef MSWINDOWS},w_window{$endif});
writeln('New window: ' + IntToStr(Selector.LastPick));
end;
procedure TForm1.NoTray(Sender: TObject);

View File

@ -151,13 +151,13 @@ end;
procedure ps_CopyClientToBitmap(bmp, xs, ys, xe, ye: Integer);
begin
CurrThread.Client.MBitmaps.GetBMP(bmp).CopyClientToBitmap(CurrThread.Client.MWindow, True, xs, ys, xe, ye);
CurrThread.Client.MBitmaps.GetBMP(bmp).CopyClientToBitmap(CurrThread.Client.IOManager, True, xs, ys, xe, ye);
end;
function BitmapFromClient(const xs, ys, xe, ye: Integer): Integer;
begin;
result := CurrThread.Client.MBitmaps.CreateBMP(0,0);
CurrThread.Client.MBitmaps.Bmp[result].CopyClientToBitmap(CurrThread.Client.MWindow,True,xs,ys,xe,ye);
CurrThread.Client.MBitmaps.Bmp[result].CopyClientToBitmap(CurrThread.Client.IOManager,True,xs,ys,xe,ye);
end;
function FindBitmap(Bitmap: integer; out x, y: Integer): Boolean;

View File

@ -23,7 +23,7 @@
function GetColor(x,y : integer) : TColor;
begin;
Result := CurrThread.Client.MWindow.GetColor(x,y);
Result := CurrThread.Client.IOManager.GetColor(x,y);
end;
function findcolor(out x, y: integer; color, x1, y1, x2, y2: integer): boolean;

View File

@ -23,25 +23,25 @@
procedure KeyDown(key: Word);
begin
CurrThread.Client.MInput.KeyDown(key);
CurrThread.Client.IOManager.KeyDown(key);
end;
procedure KeyUp(key: Word);
begin
CurrThread.Client.MInput.KeyUp(key);
CurrThread.Client.IOManager.KeyUp(key);
end;
procedure SendKeys(s: string);
begin
CurrThread.Client.MInput.SendText(s);
CurrThread.Client.IOManager.SendText(s);
end;
procedure PressKey(key: Word);
begin
CurrThread.Client.MInput.PressKey(key);
CurrThread.Client.IOManager.PressKey(key);
end;
function isKeyDown(key: Word): boolean;
begin
Result := CurrThread.Client.MInput.isKeyDown(key);
Result := CurrThread.Client.IOManager.isKeyDown(key);
end;

View File

@ -27,12 +27,12 @@ const
ps_mouse_middle = 2;
procedure MoveMouse(x, y: integer);
begin
CurrThread.Client.MInput.SetMousePos(X, Y);
CurrThread.Client.IOManager.SetMousePos(X, Y);
end;
procedure GetMousePos(out x, y: integer);
begin
CurrThread.Client.MInput.GetMousePos(X, Y);
CurrThread.Client.IOManager.GetMousePos(X, Y);
end;
function ConvIntClickType(Int : Integer) : TClickType;inline;
begin;
@ -47,17 +47,17 @@ end;
procedure HoldMouse(x, y: integer; clickType: integer);
begin
CurrThread.Client.MInput.SetMousePos(x, y);
CurrThread.Client.MInput.MouseButtonAction(x, y, ConvIntClickType(clickType), mouse_Down);
CurrThread.Client.IOManager.SetMousePos(x, y);
CurrThread.Client.IOManager.MouseButtonAction(x, y, ConvIntClickType(clickType), mouse_Down);
end;
procedure ReleaseMouse(x, y: integer; clickType: integer);
begin
CurrThread.Client.MInput.SetMousePos(x, y);
CurrThread.Client.MInput.MouseButtonAction(x, y, ConvIntClickType(clickType), mouse_Up);
CurrThread.Client.IOManager.SetMousePos(x, y);
CurrThread.Client.IOManager.MouseButtonAction(x, y, ConvIntClickType(clickType), mouse_Up);
end;
procedure ClickMouse(x, y: integer; clickType: integer);
begin
CurrThread.Client.MInput.ClickMouse(x, y, ConvIntClickType(clickType));
CurrThread.Client.IOManager.ClickMouse(x, y, ConvIntClickType(clickType));
end;

View File

@ -53,9 +53,9 @@ var
w,h : integer;
bmp: TMufasaBitmap;
begin;
CurrThread.Client.MWindow.GetDimensions(w,h);
CurrThread.Client.IOManager.GetDimensions(w,h);
bmp := TMufasaBitmap.Create;
bmp.CopyClientToBitmap(CurrThread.Client.MWindow,True,0,0,w-1,h-1);
bmp.CopyClientToBitmap(CurrThread.Client.IOManager,True,0,0,w-1,h-1);
bmp.SaveToFile(FileName);
bmp.Free;
end;

View File

@ -23,36 +23,38 @@
procedure SetDesktopAsClient;
begin;
CurrThread.Client.MWindow.SetDesktop;
CurrThread.Client.IOManager.SetDesktop;
end;
procedure SetTargetBitmap(bitmap: Integer);
begin;
With CurrThread.Client do
MWindow.SetTarget(MBitmaps.Bmp[Bitmap]);
IOManager.SetTarget(MBitmaps.Bmp[Bitmap]);
end;
procedure GetClientDimensions(out w, h: integer);
begin
CurrThread.Client.MWindow.GetDimensions(w, h);
CurrThread.Client.IOManager.GetDimensions(w, h);
end;
function Freeze: boolean;
begin
result := CurrThread.Client.MWindow.Freeze();
CurrThread.Client.IOManager.SetFrozen(true);
result := true;
end;
function Unfreeze: boolean;
begin
result := CurrThread.Client.MWindow.Unfreeze;
CurrThread.Client.IOManager.SetFrozen(false);
result := true;
end;
procedure SetTargetArray(P: Integer; w, h: integer);
begin
CurrThread.Client.MWindow.SetTarget(PRGB32(P), classes.point(w,h));
CurrThread.Client.IOManager.SetTarget(PRGB32(P), classes.point(w,h));
end;
procedure activateclient;
begin
CurrThread.Client.MWindow.ActivateClient;
CurrThread.Client.IOManager.ActivateClient;
end;

View File

@ -30,7 +30,9 @@ interface
uses
Classes, SysUtils, LCLIntf,LCLType,InterfaceBase,Forms,Controls,ExtCtrls,
Graphics,
Window,MufasaTypes, colourhistory,bitmaps,input
{$IFDEF MSWINDOWS} os_windows, {$ENDIF}
{$IFDEF LINUX} os_linux, {$ENDIF}
MufasaTypes, colourhistory,bitmaps
{$IFNDEF PICKER_CLIENT}
{$IFDEF LINUX}
@ -44,7 +46,7 @@ type
TPickEvent = procedure (Sender: TObject; Color, X, Y: Integer);
TMColorPicker = class(TObject)
constructor Create(aWindow: TMWindow);
constructor Create(manager: TIOManager);
destructor Destroy; override;
procedure Pick(Out C, X, Y: Integer);
@ -53,11 +55,7 @@ type
procedure ImageInfoMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
Procedure ColorPickUp(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);
public
// Will give us CopyClientToBitmap
Window: TMWindow;
// Created and freed in Pick.
Input: TMInput;
manager: TIOManager;
{ Form components }
ScreenForm, InfoForm : TForm;
@ -80,12 +78,12 @@ type
implementation
constructor TMColorPicker.Create(aWindow: TMWindow);
constructor TMColorPicker.Create(manager: TIOManager);
begin
inherited Create;
Self.Window := aWindow;
self.manager := manager;
end;
destructor TMColorPicker.Destroy;
@ -104,7 +102,7 @@ var
p : TPoint;
bmp: TMufasaBitmap;
Desktop : TMWindow;
Desktop : TIOManager;
begin
@ -112,12 +110,11 @@ begin
w := 0;
h := 0;
{ If the target window isn't valid (closed etc), make the destkop the new window}
if not Self.Window.TargetValid then
self.Window.SetDesktop;
Input := TMInput.Create(Self.Window);//For the correct x,y values
if not Self.Manager.TargetValid then
self.Manager.SetDesktop;
{Desktop is needed for the whole picture}
Desktop := TMWindow.Create;
Desktop := TIOManager.Create('');
Desktop.SetDesktop;
Desktop.GetDimensions(w, h);
@ -213,7 +210,6 @@ begin
InfoForm.Free;
ScreenForm.Free;
Input.Free;
Desktop.free;
{ Re-enable the color pick buttons }
@ -230,7 +226,7 @@ var
MouseX, MouseY: Integer;
begin
{ Move the info form }
Input.GetMousePos(MouseX, MouseY);
manager.GetMousePos(MouseX, MouseY);
InfoForm.Left := Mouse.CursorPos.X + 5;
InfoForm.Top := Mouse.CursorPos.Y - 15;
@ -281,7 +277,7 @@ procedure TMColorPicker.ColorPickUp(Sender: TObject; Button: TMouseButton;
begin;
{ Set the coordinates and color that the user cliked on }
Color:= WidgetSet.DCGetPixel(ImageMain.Canvas.Handle,x,y);
Input.GetMousePos(ColorX, ColorY);
Manager.GetMousePos(ColorX, ColorY);
if OnPick <> nil then
Onpick(Sender,Color,Colorx,Colory);

View File

@ -30,7 +30,9 @@ interface
uses
Classes, SysUtils,
ctypes,
window, windowutil,
{$IFDEF MSWINDOWS} os_windows, {$ENDIF}
{$IFDEF LINUX} os_linux, {$ENDIF}
windowutil,
controls,
graphics,
forms,
@ -43,17 +45,15 @@ uses
type
TMWindowSelector = class(TObject)
constructor Create(aWindow: TMWindow);
constructor Create(manager: TIOManager);
destructor Destroy; override;
{$IFDEF LINUX}
function Drag: x.TWindow;
{$ELSE}
function Drag: Hwnd;
{$ENDIF}
function Drag: TNativeWindow;
public
Window: TMWindow;
LastPick: TNativeWindow;
manager: TIOManager;
end;
@ -61,11 +61,11 @@ type
implementation
constructor TMWindowSelector.Create(aWindow: TMWindow);
constructor TMWindowSelector.Create(manager: TIOManager);
begin
inherited create;
Self.Window := aWindow;
self.manager := manager;
end;
@ -77,7 +77,7 @@ begin
end;
{$IFDEF LINUX}
function TMWindowSelector.Drag: x.TWindow;
function TMWindowSelector.Drag: TNativeWindow;
var
Tempwindow : x.TWindow;
root : x.TWindow;
@ -96,13 +96,13 @@ begin
Result := 0;
window_opacity:=XInternAtom(Window.XDisplay,PChar('_NET_WM_WINDOW_OPACITY'), False);
window_opacity:=XInternAtom(manager.display,PChar('_NET_WM_WINDOW_OPACITY'), False);
opacity_75 := cuint($ffffffff * 0.75);
opacity_100 := cuint($ffffffff);
repeat
// get pointer pos + current window we are at.
XQueryPointer(Window.XDisplay, Window.DesktopWindow, @root,
XQueryPointer(manager.display, manager.desktop, @root,
@Tempwindow, @x_root, @y_root,
@x, @y, @xmask);
subwindow:= Tempwindow;
@ -110,7 +110,7 @@ begin
while subwindow <> 0 do
begin
Tempwindow := subwindow;
XQueryPointer(Window.XDisplay, Tempwindow, @root,
XQueryPointer(manager.display, Tempwindow, @root,
@subwindow, @x_root, @y_root,
@x, @y, @xmask);
end;
@ -120,17 +120,18 @@ begin
if Result <> Tempwindow then
begin
writeln('Making ' + inttostr(tempwindow) + ' transparent');
XChangeProperty(Window.XDisplay, tempwindow, window_opacity, XA_CARDINAL, 32, PropModeReplace, @opacity_75, 1);
XChangeProperty(manager.display, tempwindow, window_opacity, XA_CARDINAL, 32, PropModeReplace, @opacity_75, 1);
writeln('Resetting ' + inttostr(Result));
if result <> 0 then
XChangeProperty(Window.XDisplay, Result, window_opacity, XA_CARDINAL, 32, PropModeReplace, @opacity_100, 1);
XChangeProperty(manager.display, Result, window_opacity, XA_CARDINAL, 32, PropModeReplace, @opacity_100, 1);
WriteLn('Changing Window from: ' + Inttostr(result) +' to: ' + IntToStr(Tempwindow));
// XChangeProperty(Window.XDisplay, tempwindow, window_opacity, XA_CARDINAL, 32, PropModeReplace, @opacity_50, 1);
Result := Tempwindow;
LastPick:= TempWindow;
end;
XFlush(Window.XDisplay);
XFlush(manager.display);
Sleep(16);
//if we are selecting for a long time, we must still process other messages
@ -138,15 +139,15 @@ begin
until (xmask and Button1Mask) = 0;
XChangeProperty(Window.XDisplay, Result, window_opacity, XA_CARDINAL, 32, PropModeReplace, @opacity_100, 1);
XFlush(Window.XDisplay);
XChangeProperty(manager.display, Result, window_opacity, XA_CARDINAL, 32, PropModeReplace, @opacity_100, 1);
XFlush(manager.display);
XSetErrorHandler(Old_handler);
end;
{$ELSE}
function TMWindowSelector.Drag: Hwnd;
function TMWindowSelector.Drag: TNativeWindow;
var
TargetRect: TRect;
DC: HDC;
@ -192,6 +193,7 @@ begin;
Sleep(64);
end;
Result := TempHandle;
LastPick:= TempHandle;
Screen.Cursor:= cursor;
Invalidaterect(temphandle, nil, true);
UpdateWindow(temphandle);

View File

@ -115,7 +115,7 @@ implementation
uses
Windowutil,paszlib,DCPbase64,math,
colour_conv,window,mufasatypesutil,tpa;
colour_conv,IOManager,mufasatypesutil,tpa;
function Min(a,b:integer) : integer;
begin
@ -674,11 +674,11 @@ begin
wi := Min(xe-xs + 1,Self.w);
hi := Min(ye-ys + 1,Self.h);
PtrRet := TMWindow(MWindow).ReturnData(xs,ys,wi,hi);
PtrRet := TIOManager_Abstract(MWindow).ReturnData(xs,ys,wi,hi);
for y := 0 to (hi-1) do
Move(PtrRet.Ptr[y * (wi + PtrRet.IncPtrWith)], FData[y * self.w],wi * SizeOf(TRGB32));
TMWindow(MWindow).FreeReturnData;
TIOManager_Abstract(MWindow).FreeReturnData;
end;
procedure TMufasaBitmap.CopyClientToBitmap(MWindow: TObject; Resize: boolean;
@ -693,11 +693,11 @@ begin
wi := Min(xe-xs + 1 + x,Self.w);
hi := Min(ye-ys + 1 + y,Self.h);
PtrRet := TMWindow(MWindow).ReturnData(xs,ys,wi - x,hi - y);
PtrRet := TIOManager_Abstract(MWindow).ReturnData(xs,ys,wi - x,hi - y);
for yy := 0 to (hi-1 - y) do
Move(PtrRet.Ptr[yy * (wi - x + PtrRet.IncPtrWith)], FData[(yy + y) * self.w + x],wi * SizeOf(TRGB32));
TMWindow(MWindow).FreeReturnData;
TIOManager_Abstract(MWindow).FreeReturnData;
end;

View File

@ -30,7 +30,9 @@ interface
uses
Classes, SysUtils, MufasaTypes,
Window, Input, Files, Finder, Bitmaps, dtm, ocr;
IOManager, Files, Finder, Bitmaps, dtm, ocr,
{$IFDEF MSWINDOWS} os_windows {$ENDIF}
{$IFDEF LINUX} os_linux {$ENDIF};
{
TClient is a full-blown instance of the MML.
@ -43,8 +45,7 @@ type
destructor Destroy; override;
public
MWindow: TMWindow;
MInput: TMInput;
IOManager: TIOManager;
MFiles: TMFiles;
MFinder: TMFinder;
MBitmaps : TMBitmaps;
@ -60,8 +61,7 @@ constructor TClient.Create;
begin
inherited Create;
MWindow := TMWindow.Create;
MInput := TMInput.Create(MWindow);
IOManager:= TIOManager.Create('./Plugins');
MFiles := TMFiles.Create;
MFinder := TMFinder.Create(Self);
MBitmaps := TMBitmaps.Create(self);
@ -76,8 +76,7 @@ begin
MBitmaps.Free;
MFinder.Free;
MFiles.Free;
MInput.Free;
MWindow.Free;
IOManager.Free;
inherited;
end;

View File

@ -351,7 +351,7 @@ begin
raise Exception.createFMT('Any Find Function, you did not pass a ' +
'correct ys: %d.', [ys]);
TClient(Self.Client).MWindow.GetDimensions(w,h);
TClient(Self.Client).IOManager.GetDimensions(w,h);
if (w <> CachedWidth) or (h <> CachedHeight) then
UpdateCachedValues(w,h);
if xe >= w then
@ -379,7 +379,7 @@ begin
dX := xe - xs;
dY := ye - ys;
ColorToRGB(Color, clR, clG, clB);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
Ptr := PtrData.Ptr;
PtrInc := PtrData.IncPtrWith;
CCts := Self.CTS;
@ -400,7 +400,7 @@ begin
end;
Inc(Ptr, PtrInc)
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.CountColor(Color, xs, ys, xe, ye: Integer): Integer;
@ -422,7 +422,7 @@ begin
//next, convert the color to r,g,b
ColorToRGB(Color, clR, clG, clB);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
// Do we want to "cache" these vars?
// We will, for now. Easier to type.
@ -441,7 +441,7 @@ begin
Inc(Ptr, PtrInc)
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindColor(out x, y: Integer; Color, xs, ys, xe, ye: Integer): Boolean;
@ -463,7 +463,7 @@ begin
//next, convert the color to r,g,b
ColorToRGB(Color, clR, clG, clB);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
// Do we want to "cache" these vars?
// We will, for now. Easier to type.
@ -481,7 +481,7 @@ begin
x := xx;
y := yy;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
Exit;
end;
Inc(Ptr);
@ -489,7 +489,7 @@ begin
Inc(Ptr, PtrInc)
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindColorSpiral(var x, y: Integer; color, xs, ys, xe,
@ -511,7 +511,7 @@ begin
//next, convert the color to r,g,b
ColorToRGB(Color, clR, clG, clB);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
//Load rowdata
RowData:= CalculateRowPtrs(ptrdata,dy+1);
//Load the spiral path
@ -526,11 +526,11 @@ begin
Result := True;
x := ClientTPA[i].x + xs;
y := ClientTPA[i].y + ys;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
Exit;
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindColoredArea(var x, y: Integer; Color, xs, ys, xe, ye, MinArea: Integer): Boolean;
@ -554,7 +554,7 @@ begin
//next, convert the color to r,g,b
ColorToRGB(Color, clR, clG, clB);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
// Do we want to "cache" these vars?
// We will, for now. Easier to type.
@ -586,7 +586,7 @@ begin
Result := True;
x := xx;
y := yy;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
Exit;
end;
end;
@ -604,7 +604,7 @@ begin
Inc(Ptr, PtrInc);
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
@ -634,7 +634,7 @@ begin
if Cts = 2 then
RGBToHSLNonFixed(clR,clG,clB,H1,S1,L1);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
// Do we want to "cache" these vars?
// We will, for now. Easier to type.
@ -730,14 +730,14 @@ begin
end;
end;
Result := False;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
Exit;
Hit:
Result := True;
x := xx;
y := yy;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindColorTolerance(out x, y: Integer; Color, xs, ys, xe, ye, tol: Integer): Boolean;
@ -766,7 +766,7 @@ begin
if Cts = 2 then
RGBToHSL(clR,clG,clB,H1,S1,L1);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
// Do we want to "cache" these vars?
// We will, for now. Easier to type.
@ -821,14 +821,14 @@ begin
end;
end;
Result := False;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
Exit;
Hit:
Result := True;
x := xx;
y := yy;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindColoredAreaTolerance(var x, y: Integer; Color, xs, ys, xe, ye, MinArea, tol: Integer): Boolean;
@ -854,7 +854,7 @@ begin
ColorToRGB(Color, clR, clG, clB);
if Cts = 2 then
RGBToHSL(clR,clG,clB,H1,S1,L1);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
// Do we want to "cache" these vars?
// We will, for now. Easier to type.
@ -899,14 +899,14 @@ begin
end;
Result := False;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
Exit;
Hit:
Result := True;
x := xx;
y := yy;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindColorsTolerance(out Points: TPointArray; Color, xs, ys,
@ -930,7 +930,7 @@ begin
if CTS = 2 then
ColorToHSL(color,H1,S1,L1);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
// Do we want to "cache" these vars?
// We will, for now. Easier to type.
@ -994,7 +994,7 @@ begin
SetLength(Points, C);
Move(ClientTPA[0], Points[0], C * SizeOf(TPoint));
Result := C > 0;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindColorsToleranceOptimised(out Points: TPointArray; Color, xs, ys,
xe, ye, Tol: Integer): Boolean;
@ -1017,7 +1017,7 @@ begin
if CTS = 2 then
RGBToHSLNonFixed(clR,clG,clB,H1,S1,L1);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
// Do we want to "cache" these vars?
// We will, for now. Easier to type.
@ -1122,7 +1122,7 @@ begin
SetLength(Points, C);
Move(ClientTPA[0], Points[0], C * SizeOf(TPoint));
Result := C > 0;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindColorsSpiralTolerance(x, y: Integer;
@ -1144,7 +1144,7 @@ begin
ColorToRGB(Color, clR, clG, clB);
ColorToHSL(Color, H1, S1, L1);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
c := 0;
@ -1199,7 +1199,7 @@ begin
SetLength(Points, C);
Move(ClientTPA[0], Points[0], C * SizeOf(TPoint));
Result := C > 0;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindColors(out TPA: TPointArray; Color, xs, ys, xe, ye: Integer): Boolean;
@ -1220,7 +1220,7 @@ begin
ColorToRGB(Color, clR, clG, clB);
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
Ptr := PtrData.Ptr;
PtrInc := PtrData.IncPtrWith;
@ -1246,7 +1246,7 @@ begin
Result := I > 0;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
{ Only works with CTS 1 for now.. Since Colorsame doesn't return a boolean :-( }
@ -1274,7 +1274,7 @@ begin
dX := xe - xs;
dY := ye - ys;
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
//Caculate the row ptrs
MainRowdata:= CalculateRowPtrs(PtrData,dy+1);
@ -1321,12 +1321,12 @@ begin
//We have found the mask appearntly, otherwise we would have jumped! Gna Gna.
x := xx + xs;
y := yy + ys;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
Exit(true);
//Bah not found the mask, lets do nothing and continue!
NotFoundMask:
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
procedure TMFinder.CheckMask(Mask: TMask);
@ -1339,7 +1339,7 @@ function TMFinder.FindBitmap(bitmap: TMufasaBitmap; out x, y: Integer): Boolean;
var
w,h : integer;
begin
TClient(Client).MWindow.GetDimensions(w,h);
TClient(Client).IOManager.GetDimensions(w,h);
result := Self.FindBitmapIn(bitmap,x,y,0,0,w-1,h-1);
end;
@ -1366,7 +1366,7 @@ begin
dX := xe - xs;
dY := ye - ys;
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
//Caculate the row ptrs
MainRowdata:= CalculateRowPtrs(PtrData,dy+1);
BmpRowData:= CalculateRowPtrs(bitmap);
@ -1393,14 +1393,14 @@ begin
end;
//We did find the Bmp, otherwise we would be at the part below
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
x := xx + xs;
y := yy + ys;
result := true;
exit;
NotFoundBmp:
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindBitmapToleranceIn(bitmap: TMufasaBitmap; out x, y: Integer; xs,
@ -1428,7 +1428,7 @@ begin
dX := xe - xs;
dY := ye - ys;
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
//Caculate the row ptrs
MainRowdata:= CalculateRowPtrs(PtrData,dy+1);
BmpRowData:= CalculateRowPtrs(bitmap);
@ -1462,14 +1462,14 @@ begin
end;
//We did find the Bmp, otherwise we would be at the part below
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
x := xx + xs;
y := yy + ys;
result := true;
exit;
NotFoundBmp:
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindBitmapSpiral(bitmap: TMufasaBitmap; var x, y: Integer;
@ -1495,7 +1495,7 @@ begin
dX := xe - xs;
dY := ye - ys;
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
//Caculate the row ptrs
MainRowdata:= CalculateRowPtrs(PtrData,dy+1);
BmpRowData:= CalculateRowPtrs(bitmap);
@ -1524,14 +1524,14 @@ begin
end;
//We did find the Bmp, otherwise we would be at the part below
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
x := ClientTPA[i].x + xs;
y := ClientTPA[i].y + ys;
result := true;
exit;
NotFoundBmp:
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindBitmapSpiralTolerance(bitmap: TMufasaBitmap; var x,
@ -1559,7 +1559,7 @@ begin
dX := xe - xs;
dY := ye - ys;
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
//Caculate the row ptrs
MainRowdata:= CalculateRowPtrs(PtrData,dy+1);
BmpRowData:= CalculateRowPtrs(bitmap);
@ -1602,7 +1602,7 @@ begin
exit;
NotFoundBmp:
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindBitmapsSpiralTolerance(bitmap: TMufasaBitmap; x,
@ -1631,7 +1631,7 @@ begin
dX := xe - xs;
dY := ye - ys;
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
//Caculate the row ptrs
MainRowdata:= CalculateRowPtrs(PtrData,dy+1);
BmpRowData:= CalculateRowPtrs(bitmap);
@ -1680,7 +1680,7 @@ begin
SetLength(Points,FoundC);
Move(ClientTPA[0], Points[0], FoundC * SizeOf(TPoint));
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
end;
function TMFinder.FindDeformedBitmapToleranceIn(bitmap: TMufasaBitmap; out x,
@ -1715,7 +1715,7 @@ begin
dY := ye - ys;
SearchDx := dX;
SearchDy := dY;
PtrData := TClient(Client).MWindow.ReturnData(xs, ys, dX + 1, dY + 1);
PtrData := TClient(Client).IOManager.ReturnData(xs, ys, dX + 1, dY + 1);
//Caculate the row ptrs
MainRowdata:= CalculateRowPtrs(PtrData,dy+1);
BmpRowData:= CalculateRowPtrs(bitmap);
@ -1775,7 +1775,7 @@ begin
BestPT := Point(xx+xs,yy+ys);
if GoodCount = TotalC then
begin;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
x := BestPT.x;
y := BestPT.y;
accuracy:= 1;
@ -1783,7 +1783,7 @@ begin
end;
end;
end;
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
if BestCount = 0 then
Exit;
accuracy := BestCount / TotalC;
@ -1880,7 +1880,7 @@ begin
C := DTM.c;
// Retreive Client Data.
PtrData := TClient(Client).MWindow.ReturnData(x1, y1, W + 1, H + 1);
PtrData := TClient(Client).IOManager.ReturnData(x1, y1, W + 1, H + 1);
cd := CalculateRowPtrs(PtrData, h + 1);
//writeln(format('w,h: %d, %d', [w,h]));
@ -1937,7 +1937,7 @@ begin
end;
TheEnd:
TClient(Client).MWindow.FreeReturnData;
TClient(Client).IOManager.FreeReturnData;
SetLength(Points, pc);
if pc > 0 then

View File

@ -0,0 +1,454 @@
unit IOManager;
interface
uses
Classes, SysUtils, mufasatypes;
type
{ This is the base class for the target functionality. If it provides a target, it extends this.
| Some methods in heregratuitous provide default functionality as a convinence. Only override as nessessary }
TTarget = class(TObject)
public
{ ONLY override some of the following methods if the target provides image functions, defaults
| to raise exceptions. GetColor provides default functionality using ReturData of width 1.
| FreeReturnData provides default of doing nothing. }
procedure GetTargetDimensions(var w, h: integer); virtual;
function GetColor(x,y : integer) : TColor; virtual;
function ReturnData(xs, ys, width, height: Integer): TRetData; virtual;
procedure FreeReturnData; virtual;
{ ONLY override the following methods if the target provides mouse functions, defaults to
| raise exceptions }
procedure GetMousePosition(var x,y: integer); virtual;
procedure MoveMouse(x,y: integer); virtual;
procedure HoldMouse(x,y: integer; left: boolean); virtual;
procedure ReleaseMouse(x,y: integer; left: boolean); virtual;
{ ONLY override the following methods if the target provides key functions, defaults to
| raise exceptions }
procedure SendString(str: PChar); virtual;
procedure HoldKey(key: integer); virtual;
procedure ReleaseKey(key: integer); virtual;
function IsKeyHeld(key: integer): boolean; virtual;
end;
{ Implements a target that is a raw pixel array, e.g. stuff from a bitmap or a frozen state.
| Currently this uses the pointer as-is, but it might be needed to make a local copy... }
TRawTarget = class(TTarget)
public
constructor Create(rgb: prgb32; w,h: integer);
destructor Destory; override;
procedure GetTargetDimensions(var w, h: integer); override;
function ReturnData(xs, ys, width, height: Integer): TRetData; override;
private
rgb: prgb32;
w,h: integer;
end;
{ Implements a target that is a Window in the operating system. This class is abstract, i.e.,
| the actual os-specific Implementation of TWindow is in one of the os units. }
TWindow_Abstract = class(TTarget)
public
procedure GetTargetDimensions(var w, h: integer); override; abstract;
function ReturnData(xs, ys, width, height: Integer): TRetData; override; abstract;
procedure GetMousePosition(var x,y: integer); override; abstract;
procedure MoveMouse(x,y: integer); override; abstract;
procedure HoldMouse(x,y: integer; left: boolean); override; abstract;
procedure ReleaseMouse(x,y: integer; left: boolean); override; abstract;
procedure SendString(str: PChar); override; abstract;
procedure HoldKey(key: integer); override; abstract;
procedure ReleaseKey(key: integer); override; abstract;
function IsKeyHeld(key: integer): boolean; override; abstract;\
end;
{ Contains the pointers to a non-internal target implementation using the EIOS specification.
| N.B. this *is* the specification that I will finalize the speficication as... Once this is
| finalized that is. Trust me, its >9000 times easier to use a buffer across the language
| barrier. And the internal target implementation of EIOS will make that verry efficient. }
TEIOS_Client = record
RequestTarget: function(initdata: pointer): pointer; stdcall;
ReleaseTarget: procedure(target: pointer); stdcall;
GetTargetDimensions: procedure(target: pointer; var w, h: integer); stdcall;
GetImageBuffer: function(target: pointer): prgb32; stdcall;
UpdateImageBuffer: procedure(target: pointer); stdcall;
UpdateImageBufferBounds: procedure(target: pointer; sx,sy,ex,ey: integer); stdcall;
GetMousePosition: procedure(target: pointer; var x,y: integer); stdcall;
MoveMouse: procedure(target: pointer; x,y: integer); stdcall;
HoldMouse: procedure(target: pointer; x,y: integer; left: boolean); stdcall;
ReleaseMouse: procedure(target: pointer; x,y: integer; left: boolean); stdcall;
SendString: procedure(target: pointer; str: PChar); stdcall;
HoldKey: procedure(target: pointer; key: integer); stdcall;
ReleaseKey: procedure(target: pointer; key: integer); stdcall;
IsKeyHeld: function(target: pointer; key: integer): boolean; stdcall;
Initialize: procedure; stdcall;
Finalize: procedure; stdcall;
end;
{ Implements a EIOS target. This is, for all intensive purposes, a TRawTarget with added
| key and mouse methods, as well as the capability to request a buffer update. N.B. that
| some EIOS implementors can and will update the buffer on their own. In that case, the
| UpdateImageBuffer call is just a call to an empty method, OR does not exist. In the case
| of an EIOS client not needing a method defined, it will not be exported and will be set
| to NIL here. I think. Will get back to that. }
TEIOS_Target = class(TTarget)
public
constructor Create(client: TEIOS_Client; initval: pointer);
destructor Destory; override;
procedure GetTargetDimensions(var w, h: integer); override;
function GetColor(x,y : integer) : TColor; override;
function ReturnData(xs, ys, width, height: Integer): TRetData; override;
procedure GetMousePosition(var x,y: integer); override;
procedure MoveMouse(x,y: integer); override;
procedure HoldMouse(x,y: integer; left: boolean); override;
procedure ReleaseMouse(x,y: integer; left: boolean); override;
procedure SendString(str: PChar); override;
procedure HoldKey(key: integer); override;
procedure ReleaseKey(key: integer); override;
function IsKeyHeld(key: integer): boolean; override;
private
client: TEIOS_Client;
target: pointer;
buffer: prgb32;
width,height: integer;
end;
{ EIOS Clients will give an exported name, have a loaded library associated, and have
| a TEIOS_Client with the method pointers set. }
type TEIOS_LoadedPlugin = record
name: string;
plugin: pointer;
client: TEIOS_Client;
end;
{ This is just a class that loads EIOS clients (like SMART) and sets them up to be used
| as targets. I hope to have a method like...
| function SetTarget(eios_name: pchar; init_args: variant): integer;
| where the init_args variant will be implied to be anything that can be cast to a pointer
| in the binary side after it gets out of PascalScript. So, the only thing to setup SMART
| would be the single call....
| SetTarget('SMART',SmartSetupRecord);
| Sexy, right? ;}
TEIOS_Controller = class(TObject)
public
constructor Create(plugin_dir: string);
destructor Destroy; override;
function ClientExists(name: string): boolean;
function GetClient(name: string): TEIOS_Client;
private
function FindClient(name:string): integer;
plugs: array of TEIOS_LoadedPlugin;
end;
{ This class specifies the object that will go in the ThreadVar to give the script access
| to targets. This class is abstract, i.e., the actual os-specific Implementation of
| TIOManager is in one of the os units.
| I assume you Simba people know what the methods you made do, and I'm mantaining
| Name -> Function compatibility from the TWindow and TMInput classes (e.g. key, image,
| and window functions). I decided to split targeting into input/output == image/keymouse,
| since they sometimes are treated as seperate entities. }
TIOManager_Abstract = class(TObject)
public
constructor Create(plugin_dir: string);
destructor Destroy; override;
procedure SetDesktop; virtual; abstract;
function SetTarget(ArrPtr: PRGB32; Size: TPoint): integer; overload;
function SetTarget(Bitmap : TMufasaBitmap) : integer; overload;
function SetTarget(name: string; initargs: pointer): integer; overload;
function TargetValid: Boolean;
function GetColor(x,y : integer) : TColor;
function ReturnData(xs, ys, width, height: Integer): TRetData;
procedure FreeReturnData;
procedure GetDimensions(var W, H: Integer);
property Frozen: boolean read IsFrozen;
procedure SetFrozen(frozen: boolean);
procedure GetMousePos(var X, Y: Integer);
procedure SetMousePos(X, Y: Integer);
procedure MouseButtonAction(x,y : integer; mClick: TClickType; mPress: TMousePress);
procedure MouseButtonActionSilent(x,y : integer; mClick: TClickType; mPress: TMousePress);
procedure ClickMouse(X, Y: Integer; mClick: TClickType);
procedure KeyUp(key: Word);
procedure KeyDown(key: Word);
procedure PressKey(key: Word);
procedure SendText(text: string);
function isKeyDown(key: Word): Boolean;
protected
controller: TEIOS_Controller;
keymouse: TTarget;
image: TTarget
frozen: TTarget;
freezebuffer: prgb32;
bothsame: boolean;
procedure SetImageTarget(target: TTarget);
procedure SetKeyMouseTarget(target: TTarget);
procedure SetBothTargets(target: TTarget);
procedure NativeInit; virtual; abstract;
procedure NativeFree; virtual; abstract;
end;
implementation
uses
{$IFDEF MSWINDOWS} os_windows {$ENDIF}
{$IFDEF LINUX} os_linux {$ENDIF};
//***implementation*** TIOManager
constructor TIOManager_Abstract.Create(plugin_dir: string);
begin
inherited Create;
controller:= nil;
keymouse:= nil;
image:= nil;
frozen:= nil;
NativeInit;
SetDesktop;
end;
destructor TIOManager_Abstract.Destroy;
begin
if bothsame then keymouse.Destroy() else
begin
keymouse.Destroy();
image.Destroy();
end;
if frozen <> nil then frozen.Destroy();
if controller <> nil then controller.Destroy();
end;
procedure TIOManager_Abstract.SetImageTarget(target: TTarget);
begin
if frozen <> nil then
raise Exception.Create('You cannot set a target when Frozen');
if not(bothsame) then image.Destroy();
image:= target;
bothsame:= false;
end;
procedure TIOManager_Abstract.SetKeyMouseTarget(target: TTarget);
begin
if not(bothsame) then keymouse.Destroy();
keymouse:= target;
bothsame:= false;
end;
procedure TIOManager_Abstract.SetBothTargets(target: TTarget);
begin
if frozen <> nil then
raise Exception.Create('You cannot set a target when Frozen');
if bothsame then image.Destroy() else
begin
image.Destroy();
keymouse.Destroy();
end;
image:= target;
keymouse:= target;
bothsame:= true;
end;
procedure TIOManager_Abstract.SetFrozen(makefrozen: boolean);
var
w,h: integer;
buffer: TRetData;
begin
if (makefrozen) and (frozen <> nil) then
raise Exception.Create('The window is already frozen.');
//BenLand100 edit: I say we leave this exception out. POLS
//if not(isfrozen) and (frozen = nil) then
// raise Exception.Create('The window is not frozen.');
if makefrozen then
begin
image.Destroy();
image:= frozen;
end else if frozen = nil then
begin
frozen:= image;
frozen.GetDimensions(w,h);
buffer:= frozen.ReturnData(0,0,w,h);
GetMem(freezebuffer, w * h * sizeof(TRGB32));
Move(PtrReturn.Ptr[0], freezebuffer[0], w*h*sizeof(TRGB32));
frozen.FreeReturnData;
image:= TRawTarget.Create(freezebuffer,w,h);
end;
end;
function TIOManager_Abstract.GetColor(x,y : integer) : TColor; begin result:= image.GetColor(x,y); end;
function TIOManager_Abstract.ReturnData(xs,yx,width,height: integer): TRetData; begin result:= image.ReturnData(xs,yx,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(name: string; initargs: pointer): integer;
var
client: TEIOS_Client;
begin
client:= controller.GetClient(name);
if client = nil then raise Exception.Create('EIOS Client by specified name does not exist');
SetBothTargets(TEIOS_Target.Create(client, initargs));
end;
function TIOManager_Abstract.TargetValid: Boolean;
begin
result:= (keymouse <> nil) and (image <> nil);
end;
//***implementation*** TTarget
procedure TTarget.GetTargetDimensions(var w, h: integer); begin raise Exception.Create('GetTargetDimensions not avaliable for this target'); end;
function TTarget.GetColor(x,y : integer) : TColor;
begin
with ReturnData(x,y,1,1) do
Result := RGBToColor(Ptr[0].r,Ptr[0].g,Ptr[0].b);
FreeReturnData;
end;
function TTarget.ReturnData(xs, ys, width, height: Integer): TRetData; begin raise Exception.Create('ReturnData not avaliable for this target'); end;
procedure TTarget.FreeReturnData; begin {do nothing by default} end;
procedure TTarget.GetMousePosition(var x,y: integer); begin raise Exception.Create('GetMousePosition not avaliable for this target'); end;
procedure TTarget.MoveMouse(x,y: integer); begin raise Exception.Create('MoveMouse not avaliable for this target'); end;
procedure TTarget.HoldMouse(x,y: integer; left: boolean); begin raise Exception.Create('HoldMouse not avaliable for this target'); end;
procedure TTarget.ReleaseMouse(x,y: integer; left: boolean); begin raise Exception.Create('ReleaseMouse not avaliable for this target'); end;
procedure TTarget.SendString(str: PChar); begin raise Exception.Create('SendString not avaliable for this target'); end;
procedure TTarget.HoldKey(key: integer); begin raise Exception.Create('HoldKey not avaliable for this target'); end;
procedure TTarget.ReleaseKey(key: integer); begin raise Exception.Create('ReleaseKey not avaliable for this target'); end;
function TTarget.IsKeyHeld(key: integer): boolean; begin raise Exception.Create('IsKeyHeld not avaliable for this target'); end;
//***implementation*** TEIOS_Target
constructor TEIOS_Target.Create(client: TEIOS_Client; initval: pointer); begin
inherited Create;
self.client:= client;
self.target:= client.RequestTarget(initval);
self.buffer:= client.GetImageBuffer(target);
client.GetTargetDimensions(target,self.width,self.height);
end;
destructor TEIOS_Target.Destroy; begin
client.ReleaseTarget(self.target);
inherited Destroy;
end;
procedure TEIOS_Target.GetTargetDimensions(var w, h: integer); begin client.GetTargetDimensions(target,w,h); end;
function TEIOS_Target.ReturnData(xs, ys, width, height: Integer): TRetData;
begin
client.UpdateImageBufferBounds(target,xs,ys,xs+width,ys+height);
result.Ptr := buffer;
result.RowLen:= self.width;
result.IncPtrWith:= result.RowLen - width;
Inc(result.Ptr, ys * result.RowLen + xs);
end;
procedure TEIOS_Target.GetMousePosition(var x,y: integer); begin client.GetMousePosition(target,x,y); end;
procedure TEIOS_Target.MoveMouse(x,y: integer); begin client.MoveMouse(target,x,y); end;
procedure TEIOS_Target.HoldMouse(x,y: integer; left: boolean); begin client.HoldMouse(target,x,y,left); end;
procedure TEIOS_Target.ReleaseMouse(x,y: integer; left: boolean); begin client.ReleaseMouse(target,x,y,left); end;
procedure TEIOS_Target.SendString(str: PChar); begin client.SendString(target,str); end;
procedure TEIOS_Target.HoldKey(key: integer); begin client.HoldKey(target,key); end;
procedure TEIOS_Target.ReleaseKey(key: integer); begin client.ReleaseKey(target,key); end;
function TEIOS_Target.IsKeyHeld(key: integer): boolean; begin result:= client.IsKeyHeld(target,key); end;
//***implementation*** TRawTarget
constructor TRawTarget.Create(rgb: prgb32; w,h: integer);
begin
inherited Create;
self.rgb:= rgb;
self.w:= w;
self.h:= h;
end;
destructor TRawTarget.Destory;
begin
{do nothing}
inherited Destroy;
end;
procedure TRawTarget.GetTargetDimensions(var w, h: integer);
begin
w:= self.w;
h:= self.h;
end;
function TRawTarget.ReturnData(xs, ys, width, height: Integer): TRetData;
begin
result.Ptr := rgb;
result.RowLen:= self.w;
result.IncPtrWith:= result.RowLen - width;
Inc(result.Ptr, ys * result.RowLen + xs);
end;
//***implementation*** TEIOS_Controller
constructor TEIOS_Controller.Create(plugin_dir: string);
begin
inherited Create;
SetLength(Plugs, 0);
//Load plugins from plugins folder
end;
destructor TEIOS_Controller.Destroy
var
i: integer;
begin
for i:= 0 to length(plugs) - 1 do
if plugs[i].plugin <> nil then
begin
//Unload plugin that was loaded
end;
inherited Destroy;
end;
function TEIOS_Controller.FindClient(name: string): integer;
var
i: integer;
begin
for i:= 0 to length(plugs) - 1 do
if plugs[i].name = name then
begin
result:= i;
exit;
end;
result:= -1;
end;
function TEIOS_Controller.ClientExists(name: string): boolean;
begin
result:= FindClient(name) >= 0;
end;
function TEIOS_Controller.GetClient(name: string): TEIOS_Client;
var
i: integer;
begin
i:= FindClient(name);
if i >= 0 then
result:= plugs[i].client
else
result:= nil;
end;
end.

View File

@ -471,7 +471,7 @@ begin
bmp.SetSize(w + 2, h + 2);
// Copy the client to out working bitmap.
bmp.CopyClientToBitmap(TClient(Client).MWindow, False, 1{0},1, sx, sy, sx + w - 1, sy + h - 1);
bmp.CopyClientToBitmap(TClient(Client).IOManager, False, 1{0},1, sx, sy, sx + w - 1, sy + h - 1);
{$IFDEF OCRSAVEBITMAP}
bmp.SaveToFile(OCRDebugPath + 'ocrinit.bmp');

View File

@ -0,0 +1,173 @@
unit os_linux;
interface
uses
Classes, SysUtils, mufasatypes, xlib, x, xutil, IOManager;
type
TWindow = class(TWindow_Abstract)
public
constructor Create(display: PDisplay; screennum: integer; window: x.TWindow);
destructor Destroy; override;
procedure GetTargetDimensions(var w, h: integer); override;
function ReturnData(xs, ys, width, height: Integer): TRetData; override;
procedure FreeReturnData; override;
procedure GetMousePosition(var x,y: integer); override;
procedure MoveMouse(x,y: integer); override;
procedure HoldMouse(x,y: integer; left: boolean); override;
procedure ReleaseMouse(x,y: integer; left: boolean); override;
procedure SendString(str: PChar); override;
procedure HoldKey(key: integer); override;
procedure ReleaseKey(key: integer); override;
function IsKeyHeld(key: integer): boolean; override;
private
display: PDisplay;
screennum: integer;
window: x.TWindow;
buffer: PXImage;
dirty: Boolean; //true if image loaded
end;
TIOManager = class(TIOManager_Abstract)
public
constructor Create(plugin_dir: string);
destructor Destroy; override;
function SetTarget(target: x.TWindow): integer; overload;
procedure SetDesktop;
private
procedure NativeInit; override;
procedure NativeFree; override;
display: PDisplay;
screennum: integer;
desktop: x.TWindow;
end;
implementation
//***implementation*** TWindow
constructor TWindow.Create(display: PDisplay; screennum: integer; window: x.TWindow);
begin
inherited Create;
self.display:= display;
self.screennum:= screennum;
self.window:= window;
self.dirty:= false;
end;
destructor TWindow.Destroy;
begin
FreeReturnData;
inherited Destroy;
end;
procedure TWindow.GetTargetDimensions(var w, h: integer);
var
Old_Handler: TXErrorHandler;
Attrib: TXWindowAttributes;
newx, newy: integer;
childwindow: x.TWindow;
begin
Old_Handler := XSetErrorHandler(@MufasaXErrorHandler);
if XGetWindowAttributes(display, window, @Attrib) <> 0 Then
begin
{ I don't think we need this XTranslateCoordinates... :D }
XTranslateCoordinates(display, seld.window, RootWindow(display, screennum), 0,0, @newx, @newy, @childwindow);
W := Attrib.Width;
H := Attrib.Height;
end else
begin
{ TODO: Raise Exception because the Window does not exist? }
W := -1;
H := -1;
end;
XSetErrorHandler(Old_Handler);
end;
function TWindow.ReturnData(xs, ys, width, height: Integer): TRetData;
var
Old_Handler: TXErrorHandler;
begin
GetDimensions(w,h);
if (xs < 0) or (xs + width > w) or (ys < 0) or (ys + height > h) then
raise Exception.CreateFMT('TMWindow.ReturnData: The parameters passed are wrong; xs,ys %d,%d width,height %d,%d',[xs,ys,width,height]);
if dirty then
raise Exception.CreateFmt('ReturnData was called again without freeing'+
' the previously used data. Do not forget to'+
' call FreeReturnData', []);
Old_Handler := XSetErrorHandler(@MufasaXErrorHandler);
buffer := XGetImage(display, window, xs, ys, width, height, AllPlanes, ZPixmap);
if buffer = nil then
begin
Writeln('ReturnData: XGetImage Error. Dumping data now:');
Writeln('xs, ys, width, height: ' + inttostr(xs) + ', ' + inttostr(ys) +
', ' + inttostr(width) + ', ' + inttostr(height));
Result.Ptr := nil;
Result.IncPtrWith := 0;
XSetErrorHandler(Old_Handler);
raise Exception.CreateFMT('TMWindow.ReturnData: ReturnData: XGetImage Error', []);
exit;
end;
Result.Ptr := PRGB32(buffer^.data);
Result.IncPtrWith := 0;
Result.RowLen := width;
dirty:= true;
XSetErrorHandler(Old_Handler);
end;
procedure TWindow.FreeReturnData;
begin
if dirty then
begin
if (buffer <> nil) then
XDestroyImage(buffer);
buffer:= nil;
dirty:= false;
end;
end;
procedure TWindow.GetMousePosition(var x,y: integer); begin end;
procedure TWindow.MoveMouse(x,y: integer); begin end;
procedure TWindow.HoldMouse(x,y: integer; left: boolean); begin end;
procedure TWindow.ReleaseMouse(x,y: integer; left: boolean); begin end;
procedure TWindow.SendString(str: PChar); begin end;
procedure TWindow.HoldKey(key: integer); begin end;
procedure TWindow.ReleaseKey(key: integer); begin end;
function TWindow.IsKeyHeld(key: integer): boolean; begin end;
//***implementation*** IOManager
procedure TIOManager.NativeInit;
begin
display := XOpenDisplay(nil);
if display = nil then
begin
// throw Exception
end;
screen := XDefaultScreenOfDisplay(display);
screennum:= DefaultScreen(display);
desktop:= RootWindow(display,screennum)
end;
procedure TIOManager.NativeFree;
begin
XCloseDisplay(display);
end;
procedure TIOManager.SetDesktop;
begin
SetBothTargets(TWindow.Create(display, screennum, desktop));
end;
function TIOManager.SetTarget(target: x.TWindow): integer;
begin
SetBothTargets(TWindow.Create(display, screennum, target))
end;

View File

@ -0,0 +1,138 @@
unit os_windows;
interface
uses
Classes, SysUtils, mufasatypes, windows, IOManager;
type
TWindow = class(TWindow_Abstract)
public
constructor Create(target: Hwnd);
destructor Destroy; override;
procedure GetTargetDimensions(var w, h: integer); override;
function ReturnData(xs, ys, width, height: Integer): TRetData; override;
function GetColor(x,y : integer) : TColor; override;
procedure GetMousePosition(var x,y: integer); override;
procedure MoveMouse(x,y: integer); override;
procedure HoldMouse(x,y: integer; left: boolean); override;
procedure ReleaseMouse(x,y: integer; left: boolean); override;
procedure SendString(str: PChar); override;
procedure HoldKey(key: integer); override;
procedure ReleaseKey(key: integer); override;
function IsKeyHeld(key: integer): boolean; override;
private
procedure ValidateBuffer(w,h:integer);
handle: Hwnd;
dc: HDC;
buffer: TBitmap;
buffer_raw: prgb32;
width,height: integer;
end;
TIOManager = class(TIOManager_Abstract)
public
constructor Create(plugin_dir: string);
destructor Destroy; override
function SetTarget(target: Hwnd): integer; overload;
procedure SetDesktop;
private
procedure NativeInit; override;
procedure NativeFree; override;
DesktopHWND : Hwnd;
end;
implementation
//***implementation*** TWindow
constructor TWindow.Create(target: Hwnd); begin
inherited Create;
self.dc:= GetDC(hwnd);
self.buffer:= TBitmap.Create;
self.buffer.PixelFormat:= pf32bit;
end;
destructor TWindow.Destroy; begin
ReleaseDC(hwnd,dc);
buffer.Free;
inherited Destroy;
end;
procedure TWindow.GetTargetDimensions(var w, h: integer);
var
Rect : TRect;
begin
GetWindowRect(self.hwnd, Rect);
w:= Rect.Right - Rect.Left;
h:= Rect.Bottom - Rect.Top;
end;
function TWindow.GetColor(x,y : integer) : TColor;
begin
result:= GetPixel(self.dc,x,y)
end;
procedure TWindow.ValidateBuffer(w,h:integer);
begin
if (w <> self.width) or (height <> self.height) then
begin
DrawBitmap.SetSize(w,h);
self.width:= w;
self.height:= h;
GetObject(DrawBitmap.Handle, SizeOf(BmpInfo), @BmpInfo);
self.buffer_raw := BmpInfo.bmBits;
end;
end;
function TWindow.ReturnData(xs, ys, width, height: Integer): TRetData;
var
temp: PRGB32;
w,h : integer;
begin
GetDimensions(w,h);
ValidateBuffer(w,h);
if (xs < 0) or (xs + width > w) or (ys < 0) or (ys + height > h) then
raise Exception.CreateFMT('TMWindow.ReturnData: The parameters passed are wrong; xs,ys %d,%d width,height %d,%d',[xs,ys,width,height]);
BitBlt(self.buffer.Canvas.Handle,0,0, width, height, self.dc, xs,ys, SRCCOPY);
Result.Ptr:= self.buffer_raw;
Result.IncPtrWith:= w - width;
Result.RowLen:= w;
end;
procedure TWindow.GetMousePosition(var x,y: integer); begin end;
procedure TWindow.MoveMouse(x,y: integer); begin end;
procedure TWindow.HoldMouse(x,y: integer; left: boolean); begin end;
procedure TWindow.ReleaseMouse(x,y: integer; left: boolean); begin end;
procedure TWindow.SendString(str: PChar); begin end;
procedure TWindow.HoldKey(key: integer); begin end;
procedure TWindow.ReleaseKey(key: integer); begin end;
function TWindow.IsKeyHeld(key: integer): boolean; begin end;
//***implementation*** IOManager
procedure TIOManager.NativeInit;
begin
self.DesktopHWND:= GetDesktopWindow;
end;
procedure TIOManager.NativeFree;
begin
end;
procedure TIOManager.SetDesktop;
begin
SetBothTargets(TWindow.Create(DesktopHWND));
end;
function TIOManager.SetTarget(target: Hwnd): integer;
begin
SetBothTargets(TWindow.Create(hwnd));
end;