1
0
mirror of https://github.com/moparisthebest/Simba synced 2025-01-31 07:10:28 -05:00
Note that the old repos version of TargetValid for Linux doesn't seem to work, and wasn't exported to PascalScript, so I added that as well...


git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@451 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
BenLand100 2010-01-22 21:30:20 +00:00
parent 798444e4fd
commit 3d4131af95
7 changed files with 111 additions and 176 deletions

View File

@ -38,7 +38,7 @@
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item2> </Item2>
</RequiredPackages> </RequiredPackages>
<Units Count="291"> <Units Count="292">
<Unit0> <Unit0>
<Filename Value="project1.lpr"/> <Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
@ -141,9 +141,7 @@
<UnitName Value="TestUnit"/> <UnitName Value="TestUnit"/>
<CursorPos X="3" Y="1550"/> <CursorPos X="3" Y="1550"/>
<TopLine Value="1548"/> <TopLine Value="1548"/>
<EditorIndex Value="8"/>
<UsageCount Value="202"/> <UsageCount Value="202"/>
<Loaded Value="True"/>
</Unit13> </Unit13>
<Unit14> <Unit14>
<Filename Value="../Compilertje/Units/CogatUnits/compinput.pas"/> <Filename Value="../Compilertje/Units/CogatUnits/compinput.pas"/>
@ -189,9 +187,9 @@
<Filename Value="../../Units/MMLCore/client.pas"/> <Filename Value="../../Units/MMLCore/client.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="Client"/> <UnitName Value="Client"/>
<CursorPos X="17" Y="36"/> <CursorPos X="15" Y="67"/>
<TopLine Value="27"/> <TopLine Value="49"/>
<EditorIndex Value="0"/> <EditorIndex Value="3"/>
<UsageCount Value="201"/> <UsageCount Value="201"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit20> </Unit20>
@ -201,9 +199,7 @@
<UnitName Value="MufasaTypes"/> <UnitName Value="MufasaTypes"/>
<CursorPos X="20" Y="32"/> <CursorPos X="20" Y="32"/>
<TopLine Value="26"/> <TopLine Value="26"/>
<EditorIndex Value="11"/>
<UsageCount Value="201"/> <UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit21> </Unit21>
<Unit22> <Unit22>
<Filename Value="../../Units/MMLCore/files.pas"/> <Filename Value="../../Units/MMLCore/files.pas"/>
@ -268,9 +264,9 @@
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="mmlpsthread"/> <UnitName Value="mmlpsthread"/>
<CursorPos X="27" Y="344"/> <CursorPos X="31" Y="260"/>
<TopLine Value="318"/> <TopLine Value="243"/>
<EditorIndex Value="1"/> <EditorIndex Value="6"/>
<UsageCount Value="202"/> <UsageCount Value="202"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit30> </Unit30>
@ -350,9 +346,11 @@
<Filename Value="../../Units/MMLCore/bitmaps.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="bitmaps"/> <UnitName Value="bitmaps"/>
<CursorPos X="85" Y="113"/> <CursorPos X="12" Y="93"/>
<TopLine Value="94"/> <TopLine Value="83"/>
<EditorIndex Value="7"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit42> </Unit42>
<Unit43> <Unit43>
<Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpcanvas.pp"/> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpcanvas.pp"/>
@ -372,9 +370,7 @@
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="15"/>
<UsageCount Value="201"/> <UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit45> </Unit45>
<Unit46> <Unit46>
<Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpcanvas.inc"/> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpcanvas.inc"/>
@ -531,9 +527,7 @@
<UnitName Value="uPSRuntime"/> <UnitName Value="uPSRuntime"/>
<CursorPos X="89" Y="10"/> <CursorPos X="89" Y="10"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="7"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit69> </Unit69>
<Unit70> <Unit70>
<Filename Value="../../Units/MMLAddon/plugins.pas"/> <Filename Value="../../Units/MMLAddon/plugins.pas"/>
@ -669,9 +663,7 @@
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/dtm.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/dtm.inc"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="16"/>
<UsageCount Value="53"/> <UsageCount Value="53"/>
<Loaded Value="True"/>
</Unit88> </Unit88>
<Unit89> <Unit89>
<Filename Value="../../../cogat/compscript.pas"/> <Filename Value="../../../cogat/compscript.pas"/>
@ -769,10 +761,10 @@
</Unit102> </Unit102>
<Unit103> <Unit103>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/window.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/window.inc"/>
<CursorPos X="1" Y="1"/> <CursorPos X="12" Y="63"/>
<TopLine Value="1"/> <TopLine Value="30"/>
<EditorIndex Value="3"/> <EditorIndex Value="1"/>
<UsageCount Value="11"/> <UsageCount Value="13"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit103> </Unit103>
<Unit104> <Unit104>
@ -818,9 +810,7 @@
<UnitName Value="uPSDebugger"/> <UnitName Value="uPSDebugger"/>
<CursorPos X="13" Y="627"/> <CursorPos X="13" Y="627"/>
<TopLine Value="323"/> <TopLine Value="323"/>
<EditorIndex Value="6"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit110> </Unit110>
<Unit111> <Unit111>
<Filename Value="../../Units/MMLCore/web.pas"/> <Filename Value="../../Units/MMLCore/web.pas"/>
@ -1204,9 +1194,7 @@
<UnitName Value="colourhistory"/> <UnitName Value="colourhistory"/>
<CursorPos X="59" Y="72"/> <CursorPos X="59" Y="72"/>
<TopLine Value="54"/> <TopLine Value="54"/>
<EditorIndex Value="4"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit166> </Unit166>
<Unit167> <Unit167>
<Filename Value="../../../Documents/lazarus/lcl/comctrls.pp"/> <Filename Value="../../../Documents/lazarus/lcl/comctrls.pp"/>
@ -1375,9 +1363,7 @@
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/keyboard.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/keyboard.inc"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="12"/>
<UsageCount Value="21"/> <UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit191> </Unit191>
<Unit192> <Unit192>
<Filename Value="../../../Documents/fpc/packages/x11/src/xlib.pp"/> <Filename Value="../../../Documents/fpc/packages/x11/src/xlib.pp"/>
@ -1599,7 +1585,7 @@
<UnitName Value="framefunctionlist"/> <UnitName Value="framefunctionlist"/>
<CursorPos X="26" Y="295"/> <CursorPos X="26" Y="295"/>
<TopLine Value="7"/> <TopLine Value="7"/>
<UsageCount Value="173"/> <UsageCount Value="175"/>
</Unit223> </Unit223>
<Unit224> <Unit224>
<Filename Value="../../../usr/local/share/lazarus/lcl/comctrls.pp"/> <Filename Value="../../../usr/local/share/lazarus/lcl/comctrls.pp"/>
@ -1654,7 +1640,7 @@
<UnitName Value="simpleanalyzer"/> <UnitName Value="simpleanalyzer"/>
<CursorPos X="52" Y="104"/> <CursorPos X="52" Y="104"/>
<TopLine Value="193"/> <TopLine Value="193"/>
<UsageCount Value="160"/> <UsageCount Value="162"/>
</Unit231> </Unit231>
<Unit232> <Unit232>
<Filename Value="../../Units/Misc/mPasLex.pas"/> <Filename Value="../../Units/Misc/mPasLex.pas"/>
@ -1712,9 +1698,9 @@
</Unit239> </Unit239>
<Unit240> <Unit240>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<CursorPos X="8" Y="61"/> <CursorPos X="40" Y="59"/>
<TopLine Value="36"/> <TopLine Value="36"/>
<EditorIndex Value="10"/> <EditorIndex Value="2"/>
<UsageCount Value="24"/> <UsageCount Value="24"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit240> </Unit240>
@ -1731,7 +1717,7 @@
<UnitName Value="updater"/> <UnitName Value="updater"/>
<CursorPos X="38" Y="211"/> <CursorPos X="38" Y="211"/>
<TopLine Value="65"/> <TopLine Value="65"/>
<UsageCount Value="133"/> <UsageCount Value="135"/>
</Unit242> </Unit242>
<Unit243> <Unit243>
<Filename Value="updateform.pas"/> <Filename Value="updateform.pas"/>
@ -1742,7 +1728,7 @@
<ComponentState Value="1"/> <ComponentState Value="1"/>
<CursorPos X="111" Y="102"/> <CursorPos X="111" Y="102"/>
<TopLine Value="207"/> <TopLine Value="207"/>
<UsageCount Value="128"/> <UsageCount Value="130"/>
</Unit243> </Unit243>
<Unit244> <Unit244>
<Filename Value="../../../Documents/lazarus/lcl/fileutil.pas"/> <Filename Value="../../../Documents/lazarus/lcl/fileutil.pas"/>
@ -1863,7 +1849,7 @@
<UnitName Value="simbasettings"/> <UnitName Value="simbasettings"/>
<CursorPos X="26" Y="9"/> <CursorPos X="26" Y="9"/>
<TopLine Value="11"/> <TopLine Value="11"/>
<UsageCount Value="91"/> <UsageCount Value="93"/>
</Unit261> </Unit261>
<Unit262> <Unit262>
<Filename Value="../../Units/MMLAddon/settings.pas"/> <Filename Value="../../Units/MMLAddon/settings.pas"/>
@ -1901,7 +1887,7 @@
<UnitName Value="reportbug"/> <UnitName Value="reportbug"/>
<CursorPos X="53" Y="23"/> <CursorPos X="53" Y="23"/>
<TopLine Value="21"/> <TopLine Value="21"/>
<UsageCount Value="74"/> <UsageCount Value="76"/>
</Unit266> </Unit266>
<Unit267> <Unit267>
<Filename Value="../../Units/Synapse/synsock.pas"/> <Filename Value="../../Units/Synapse/synsock.pas"/>
@ -1958,7 +1944,7 @@
<UnitName Value="newinternets"/> <UnitName Value="newinternets"/>
<CursorPos X="37" Y="171"/> <CursorPos X="37" Y="171"/>
<TopLine Value="153"/> <TopLine Value="153"/>
<UsageCount Value="70"/> <UsageCount Value="72"/>
</Unit274> </Unit274>
<Unit275> <Unit275>
<Filename Value="reportbug.lrs"/> <Filename Value="reportbug.lrs"/>
@ -2004,19 +1990,19 @@
<Unit281> <Unit281>
<Filename Value="../../Units/MMLCore/iomanager.pas"/> <Filename Value="../../Units/MMLCore/iomanager.pas"/>
<UnitName Value="IOManager"/> <UnitName Value="IOManager"/>
<CursorPos X="1" Y="543"/> <CursorPos X="67" Y="396"/>
<TopLine Value="526"/> <TopLine Value="377"/>
<EditorIndex Value="9"/> <EditorIndex Value="0"/>
<UsageCount Value="25"/> <UsageCount Value="27"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit281> </Unit281>
<Unit282> <Unit282>
<Filename Value="../../Units/MMLCore/os_linux.pas"/> <Filename Value="../../Units/MMLCore/os_linux.pas"/>
<UnitName Value="os_linux"/> <UnitName Value="os_linux"/>
<CursorPos X="9" Y="342"/> <CursorPos X="32" Y="165"/>
<TopLine Value="325"/> <TopLine Value="153"/>
<EditorIndex Value="14"/> <EditorIndex Value="5"/>
<UsageCount Value="25"/> <UsageCount Value="26"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit282> </Unit282>
<Unit283> <Unit283>
@ -2029,10 +2015,10 @@
<Unit284> <Unit284>
<Filename Value="../../Units/MMLCore/os_windows.pas"/> <Filename Value="../../Units/MMLCore/os_windows.pas"/>
<UnitName Value="os_windows"/> <UnitName Value="os_windows"/>
<CursorPos X="3" Y="314"/> <CursorPos X="22" Y="164"/>
<TopLine Value="300"/> <TopLine Value="155"/>
<EditorIndex Value="13"/> <EditorIndex Value="8"/>
<UsageCount Value="21"/> <UsageCount Value="22"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit284> </Unit284>
<Unit285> <Unit285>
@ -2055,7 +2041,7 @@
<UnitName Value="libloader"/> <UnitName Value="libloader"/>
<CursorPos X="1" Y="149"/> <CursorPos X="1" Y="149"/>
<TopLine Value="128"/> <TopLine Value="128"/>
<UsageCount Value="28"/> <UsageCount Value="30"/>
</Unit287> </Unit287>
<Unit288> <Unit288>
<Filename Value="../../Units/MMLAddon/tpa.pas"/> <Filename Value="../../Units/MMLAddon/tpa.pas"/>
@ -2066,10 +2052,10 @@
</Unit288> </Unit288>
<Unit289> <Unit289>
<Filename Value="../../Units/PascalScript/x86.inc"/> <Filename Value="../../Units/PascalScript/x86.inc"/>
<CursorPos X="1" Y="162"/> <CursorPos X="8" Y="157"/>
<TopLine Value="134"/> <TopLine Value="140"/>
<EditorIndex Value="2"/> <EditorIndex Value="4"/>
<UsageCount Value="10"/> <UsageCount Value="12"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit289> </Unit289>
<Unit290> <Unit290>
@ -2077,132 +2063,48 @@
<UnitName Value="uPSUtils"/> <UnitName Value="uPSUtils"/>
<CursorPos X="63" Y="722"/> <CursorPos X="63" Y="722"/>
<TopLine Value="713"/> <TopLine Value="713"/>
<EditorIndex Value="5"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit290> </Unit290>
<Unit291>
<Filename Value="../../Units/PascalScript/x64.inc"/>
<CursorPos X="6" Y="37"/>
<TopLine Value="37"/>
<UsageCount Value="11"/>
</Unit291>
</Units> </Units>
<JumpHistory Count="30" HistoryIndex="29"> <JumpHistory Count="8" HistoryIndex="7">
<Position1> <Position1>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="295" Column="29" TopLine="278"/> <Caret Line="543" Column="1" TopLine="526"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/window.inc"/>
<Caret Line="333" Column="31" TopLine="316"/> <Caret Line="37" Column="1" TopLine="19"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/window.inc"/>
<Caret Line="334" Column="41" TopLine="316"/> <Caret Line="1" Column="1" TopLine="1"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="../../Units/MMLCore/iomanager.pas"/> <Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="543" Column="1" TopLine="526"/> <Caret Line="1" Column="1" TopLine="524"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/PascalScript/x86.inc"/>
<Caret Line="560" Column="43" TopLine="537"/> <Caret Line="592" Column="60" TopLine="584"/>
</Position5> </Position5>
<Position6> <Position6>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLCore/client.pas"/>
<Caret Line="571" Column="76" TopLine="537"/> <Caret Line="36" Column="17" TopLine="27"/>
</Position6> </Position6>
<Position7> <Position7>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/> <Filename Value="../../Units/MMLCore/os_linux.pas"/>
<Caret Line="64" Column="24" TopLine="36"/> <Caret Line="48" Column="50" TopLine="34"/>
</Position7> </Position7>
<Position8> <Position8>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="61" Column="8" TopLine="36"/> <Caret Line="345" Column="27" TopLine="311"/>
</Position8> </Position8>
<Position9>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="511" Column="27" TopLine="494"/>
</Position9>
<Position10>
<Filename Value="testunit.pas"/>
<Caret Line="1439" Column="47" TopLine="1421"/>
</Position10>
<Position11>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="511" Column="29" TopLine="494"/>
</Position11>
<Position12>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="508" Column="18" TopLine="491"/>
</Position12>
<Position13>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="105" Column="22" TopLine="88"/>
</Position13>
<Position14>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="344" Column="19" TopLine="325"/>
</Position14>
<Position15>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="344" Column="10" TopLine="327"/>
</Position15>
<Position16>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="106" Column="27" TopLine="89"/>
</Position16>
<Position17>
<Filename Value="../../Units/PascalScript/x86.inc"/>
<Caret Line="330" Column="29" TopLine="316"/>
</Position17>
<Position18>
<Filename Value="colourhistory.pas"/>
<Caret Line="73" Column="7" TopLine="55"/>
</Position18>
<Position19>
<Filename Value="../../Units/PascalScript/uPSDebugger.pas"/>
<Caret Line="627" Column="13" TopLine="323"/>
</Position19>
<Position20>
<Filename Value="../../Units/PascalScript/x86.inc"/>
<Caret Line="162" Column="1" TopLine="145"/>
</Position20>
<Position21>
<Filename Value="../../Units/PascalScript/x86.inc"/>
<Caret Line="330" Column="1" TopLine="313"/>
</Position21>
<Position22>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/window.inc"/>
<Caret Line="37" Column="1" TopLine="19"/>
</Position22>
<Position23>
<Filename Value="../../Units/PascalScript/x86.inc"/>
<Caret Line="154" Column="16" TopLine="145"/>
</Position23>
<Position24>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="115" Column="45" TopLine="106"/>
</Position24>
<Position25>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="128" Column="62" TopLine="106"/>
</Position25>
<Position26>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="131" Column="62" TopLine="106"/>
</Position26>
<Position27>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="344" Column="27" TopLine="318"/>
</Position27>
<Position28>
<Filename Value="../../Units/PascalScript/x86.inc"/>
<Caret Line="162" Column="1" TopLine="134"/>
</Position28>
<Position29>
<Filename Value="../../Units/PascalScript/uPSUtils.pas"/>
<Caret Line="730" Column="5" TopLine="713"/>
</Position29>
<Position30>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/window.inc"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position30>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -26,10 +26,14 @@ begin;
CurrThread.Client.IOManager.SetDesktop; CurrThread.Client.IOManager.SetDesktop;
end; end;
procedure SetTargetArray(P: Integer; w, h: integer);
begin
CurrThread.Client.IOManager.SetTarget(PRGB32(P), classes.point(w,h));
end;
procedure SetTargetBitmap(bitmap: Integer); procedure SetTargetBitmap(bitmap: Integer);
begin; begin;
With CurrThread.Client do CurrThread.Client.IOManager.SetTarget(CurrThread.Client.MBitmaps.Bmp[Bitmap]);
IOManager.SetTarget(MBitmaps.Bmp[Bitmap]);
end; end;
procedure GetClientDimensions(out w, h: integer); procedure GetClientDimensions(out w, h: integer);
@ -40,21 +44,21 @@ end;
function Freeze: boolean; function Freeze: boolean;
begin begin
CurrThread.Client.IOManager.SetFrozen(true); CurrThread.Client.IOManager.SetFrozen(true);
result := true; result := true; //dunno what the result is supposed to mean
end; end;
function Unfreeze: boolean; function Unfreeze: boolean;
begin begin
CurrThread.Client.IOManager.SetFrozen(false); CurrThread.Client.IOManager.SetFrozen(false);
result := true; result := true; //dunno what the result is supposed to mean
end; end;
procedure SetTargetArray(P: Integer; w, h: integer); procedure ActivateClient;
begin
CurrThread.Client.IOManager.SetTarget(PRGB32(P), classes.point(w,h));
end;
procedure activateclient;
begin begin
CurrThread.Client.IOManager.ActivateClient; CurrThread.Client.IOManager.ActivateClient;
end; end;
function IsTargetValid: boolean;
begin
result:= CurrThread.Client.IOManager.TargetValid;
end;

View File

@ -56,13 +56,14 @@ AddFunction(@ps_RandomRange,'function RandomRange(aFrom,aTo: Integer): Integer;'
{window} {window}
SetCurrSection('Window'); SetCurrSection('Window');
AddFunction(@Freeze, 'function Freeze:boolean;'); AddFunction(@Freeze, 'function Freeze: boolean;');
AddFunction(@Unfreeze, 'function Unfreeze: boolean;'); AddFunction(@Unfreeze, 'function Unfreeze: boolean;');
AddFunction(@GetClientDimensions, 'procedure GetClientDimensions(var w, h:integer);'); AddFunction(@GetClientDimensions, 'procedure GetClientDimensions(var w, h:integer);');
AddFunction(@SetTargetBitmap,'procedure SetTargetBitmap(Bitmap : integer);'); AddFunction(@SetTargetBitmap,'procedure SetTargetBitmap(Bitmap : integer);');
AddFunction(@SetDesktopAsClient,'procedure SetDesktopAsClient'); AddFunction(@SetDesktopAsClient,'procedure SetDesktopAsClient');
AddFunction(@SetTargetArray, 'procedure SetTargetArray(P: Integer; w, h: integer);'); AddFunction(@SetTargetArray, 'procedure SetTargetArray(P: Integer; w, h: integer);');
AddFunction(@ActivateClient, 'procedure activateclient;'); AddFunction(@ActivateClient, 'procedure ActivateClient;');
AddFunction(@IsTargetValid, 'function IsTargetValid: boolean;');
{files} {files}
SetCurrSection('Files'); SetCurrSection('Files');

View File

@ -258,6 +258,7 @@ end;
{$I PSInc/Wrappers/other.inc} {$I PSInc/Wrappers/other.inc}
{$I PSInc/Wrappers/bitmap.inc} {$I PSInc/Wrappers/bitmap.inc}
{$I PSInc/Wrappers/window.inc} {$I PSInc/Wrappers/window.inc}
{$I PSInc/Wrappers/strings.inc} {$I PSInc/Wrappers/strings.inc}
{$I PSInc/Wrappers/colour.inc} {$I PSInc/Wrappers/colour.inc}

View File

@ -44,6 +44,7 @@ interface
function ReturnData(xs, ys, width, height: Integer): TRetData; virtual; function ReturnData(xs, ys, width, height: Integer): TRetData; virtual;
procedure FreeReturnData; virtual; procedure FreeReturnData; virtual;
procedure ActivateClient; virtual; procedure ActivateClient; virtual;
function TargetValid: boolean; virtual;
{ ONLY override the following methods if the target provides mouse functions, defaults to { ONLY override the following methods if the target provides mouse functions, defaults to
| raise exceptions } | raise exceptions }
@ -82,6 +83,7 @@ interface
procedure GetTargetDimensions(var w, h: integer); override; abstract; procedure GetTargetDimensions(var w, h: integer); override; abstract;
function ReturnData(xs, ys, width, height: Integer): TRetData; override; abstract; function ReturnData(xs, ys, width, height: Integer): TRetData; override; abstract;
function TargetValid: boolean; override; abstract;
procedure ActivateClient; override; abstract; procedure ActivateClient; override; abstract;
procedure GetMousePosition(var x,y: integer); override; abstract; procedure GetMousePosition(var x,y: integer); override; abstract;
procedure MoveMouse(x,y: integer); override; abstract; procedure MoveMouse(x,y: integer); override; abstract;
@ -313,10 +315,11 @@ implementation
//BenLand100 edit: I say we leave this exception out. POLS //BenLand100 edit: I say we leave this exception out. POLS
//if not(isfrozen) and (frozen = nil) then //if not(isfrozen) and (frozen = nil) then
// raise Exception.Create('The window is not frozen.'); // raise Exception.Create('The window is not frozen.');
if makefrozen then if not(makefrozen) then
begin begin
image.Destroy(); image.Free();
image:= frozen; image:= frozen;
frozen:= nil;
end else if frozen = nil then end else if frozen = nil then
begin begin
frozen:= image; frozen:= image;
@ -351,7 +354,11 @@ implementation
function TIOManager_Abstract.TargetValid: Boolean; function TIOManager_Abstract.TargetValid: Boolean;
begin begin
result:= (keymouse <> nil) and (image <> nil); result:= false;
if (keymouse <> nil) and (image <> nil) then
begin
end;
end; end;
procedure TIOManager_Abstract.GetDimensions(var W, H: Integer); begin image.GetTargetDimensions(w,h) end; procedure TIOManager_Abstract.GetDimensions(var W, H: Integer); begin image.GetTargetDimensions(w,h) end;
@ -386,6 +393,7 @@ implementation
function TTarget.ReturnData(xs, ys, width, height: Integer): TRetData; begin raise Exception.Create('ReturnData not avaliable for this target'); 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.FreeReturnData; begin {do nothing by default} end;
procedure TTarget.ActivateClient; begin raise Exception.Create('ActivateClient not avaliable for this target'); end; procedure TTarget.ActivateClient; begin raise Exception.Create('ActivateClient not avaliable for this target'); end;
function TTarget.TargetValid: boolean; begin result:= true; end;
procedure TTarget.GetMousePosition(var x,y: integer); begin raise Exception.Create('GetMousePosition not avaliable for this target'); 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.MoveMouse(x,y: integer); begin raise Exception.Create('MoveMouse not avaliable for this target'); end;

View File

@ -46,6 +46,7 @@ interface
function ReturnData(xs, ys, width, height: Integer): TRetData; override; function ReturnData(xs, ys, width, height: Integer): TRetData; override;
procedure FreeReturnData; override; procedure FreeReturnData; override;
function TargetValid: boolean; override;
procedure ActivateClient; override; procedure ActivateClient; override;
procedure GetMousePosition(var x,y: integer); override; procedure GetMousePosition(var x,y: integer); override;
procedure MoveMouse(x,y: integer); override; procedure MoveMouse(x,y: integer); override;
@ -154,6 +155,18 @@ implementation
XSetErrorHandler(Old_Handler); XSetErrorHandler(Old_Handler);
end; end;
function TWindow.TargetValid: boolean;
var
old_handler: TXErrorHandler;
Attrib: TXWindowAttributes;
begin
old_handler := XSetErrorHandler(@MufasaXErrorHandler);
//This was in the repos, but it doesn't seem to work...
//Maybe I missed something?
result:= XGetWindowAttributes(display, window, @Attrib) <> 0;
XSetErrorHandler(old_handler);
end;
procedure TWindow.ActivateClient; procedure TWindow.ActivateClient;
var var
Old_Handler: TXErrorHandler; Old_Handler: TXErrorHandler;

View File

@ -47,6 +47,7 @@ interface
function ReturnData(xs, ys, width, height: Integer): TRetData; override; function ReturnData(xs, ys, width, height: Integer): TRetData; override;
function GetColor(x,y : integer) : TColor; override; function GetColor(x,y : integer) : TColor; override;
function TargetValid: boolean; override;
procedure ActivateClient; override; procedure ActivateClient; override;
procedure GetMousePosition(var x,y: integer); override; procedure GetMousePosition(var x,y: integer); override;
procedure MoveMouse(x,y: integer); override; procedure MoveMouse(x,y: integer); override;
@ -159,6 +160,11 @@ implementation
inherited Destroy; inherited Destroy;
end; end;
function TWindow.TargetValid: boolean;
begin
result:= IsWindow(handle);
end;
procedure TWindow.ActivateClient; procedure TWindow.ActivateClient;
begin begin
SetForegroundWindow(handle); SetForegroundWindow(handle);