mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-24 02:02:17 -05:00
Simba: Cleanups in several units.
os_windows probably _DOES_ _NOT_ compile yet.
This commit is contained in:
parent
d7d2491f60
commit
45b215efd9
@ -5,7 +5,7 @@ unit XTest;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, x, xutil, xlib, ctypes, XKB, xinput;
|
||||
Classes, SysUtils, x, xlib, ctypes, xinput;
|
||||
|
||||
{ type
|
||||
PXDevice = Pointer; // ^XDevice ? }
|
||||
|
@ -31,8 +31,8 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, client, uPSComponent,uPSCompiler,
|
||||
uPSRuntime,stdCtrls, uPSPreProcessor,MufasaTypes,MufasaBase, web,
|
||||
bitmaps, plugins, libloader, dynlibs,internets,scriptproperties,
|
||||
uPSRuntime, uPSPreProcessor,MufasaTypes,MufasaBase, web,
|
||||
bitmaps, plugins, dynlibs,internets,scriptproperties,
|
||||
settings,settingssandbox, lcltype, dialogs
|
||||
{$IFDEF USE_RUTIS}
|
||||
,Rutis_Engine,Rutis_Defs
|
||||
@ -443,8 +443,7 @@ function TMThread.ProcessDirective(Sender: TPSPreProcessor;
|
||||
Parser: TPSPascalPreProcessorParser;
|
||||
DirectiveName, DirectiveArgs: string; FileName: string): boolean;
|
||||
var
|
||||
plugin_idx, i: integer;
|
||||
path : string;
|
||||
plugin_idx: integer;
|
||||
|
||||
begin
|
||||
Result := False;
|
||||
@ -988,8 +987,7 @@ begin
|
||||
end;
|
||||
|
||||
constructor TCPThread.Create(CreateSuspended: Boolean; TheSyncInfo : PSyncInfo; plugin_dir: string);
|
||||
var
|
||||
plugin_idx: integer;
|
||||
|
||||
begin
|
||||
inherited Create(CreateSuspended, TheSyncInfo, plugin_dir);
|
||||
if libcpascal = 0 then
|
||||
|
@ -42,8 +42,8 @@ interface
|
||||
{ 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;
|
||||
procedure GetTargetPosition(var left, top: integer); virtual;
|
||||
procedure GetTargetDimensions(out w, h: integer); virtual;
|
||||
procedure GetTargetPosition(out left, top: integer); virtual;
|
||||
function GetColor(x,y : integer) : TColor; virtual;
|
||||
function ReturnData(xs, ys, width, height: Integer): TRetData; virtual;
|
||||
procedure FreeReturnData; virtual;
|
||||
@ -57,7 +57,7 @@ interface
|
||||
|
||||
{ ONLY override the following methods if the target provides mouse functions, defaults to
|
||||
| raise exceptions }
|
||||
procedure GetMousePosition(var x,y: integer); virtual;
|
||||
procedure GetMousePosition(out x,y: integer); virtual;
|
||||
procedure MoveMouse(x,y: integer); virtual;
|
||||
procedure ScrollMouse(x,y : integer; Lines : integer); virtual;
|
||||
procedure HoldMouse(x,y: integer; button: TClickType); virtual;
|
||||
@ -80,8 +80,8 @@ interface
|
||||
constructor Create(rgb: prgb32; w,h: integer; CopyData : boolean = false);
|
||||
destructor Destroy; override;
|
||||
|
||||
procedure GetTargetDimensions(var w, h: integer); override;
|
||||
procedure GetTargetPosition(var left, top: integer); override;
|
||||
procedure GetTargetDimensions(out w, h: integer); override;
|
||||
procedure GetTargetPosition(out left, top: integer); override;
|
||||
function ReturnData(xs, ys, width, height: Integer): TRetData; override;
|
||||
|
||||
protected
|
||||
@ -95,7 +95,7 @@ interface
|
||||
constructor Create(bitmap: TMufasaBitmap);
|
||||
destructor Destroy; override;
|
||||
|
||||
procedure GetTargetDimensions(var w, h: integer); override;
|
||||
procedure GetTargetDimensions(out w, h: integer); override;
|
||||
function ReturnData(xs, ys, width, height: Integer): TRetData; override;
|
||||
|
||||
protected
|
||||
@ -109,14 +109,14 @@ interface
|
||||
|
||||
TWindow_Abstract = class(TTarget)
|
||||
public
|
||||
procedure GetTargetDimensions(var w, h: integer); override; abstract;
|
||||
procedure GetTargetPosition(var left, top: integer); override; abstract;
|
||||
procedure GetTargetDimensions(out w, h: integer); override; abstract;
|
||||
procedure GetTargetPosition(out left, top: integer); override; abstract;
|
||||
function ReturnData(xs, ys, width, height: Integer): TRetData; override; abstract;
|
||||
|
||||
function TargetValid: boolean; override; abstract;
|
||||
|
||||
procedure ActivateClient; override; abstract;
|
||||
procedure GetMousePosition(var x,y: integer); override; abstract;
|
||||
procedure GetMousePosition(out x,y: integer); override; abstract;
|
||||
procedure MoveMouse(x,y: integer); override; abstract;
|
||||
procedure ScrollMouse(x,y : integer; Lines : integer); override; abstract;
|
||||
procedure HoldMouse(x,y: integer; button: TClickType); override; abstract;
|
||||
@ -172,11 +172,11 @@ interface
|
||||
constructor Create(client: TEIOS_Client; initval: pointer);
|
||||
destructor Destroy; override;
|
||||
|
||||
procedure GetTargetDimensions(var w, h: integer); override;
|
||||
procedure GetTargetPosition(var left, top: integer); override;
|
||||
procedure GetTargetDimensions(out w, h: integer); override;
|
||||
procedure GetTargetPosition(out left, top: integer); override;
|
||||
function ReturnData(xs, ys, width, height: Integer): TRetData; override;
|
||||
|
||||
procedure GetMousePosition(var x,y: integer); override;
|
||||
procedure GetMousePosition(out x,y: integer); override;
|
||||
procedure MoveMouse(x,y: integer); override;
|
||||
procedure ScrollMouse(x,y : integer; Lines : integer); override;
|
||||
procedure HoldMouse(x,y: integer; button: TClickType); override;
|
||||
@ -283,7 +283,7 @@ interface
|
||||
function ReturnData(xs, ys, width, height: Integer): TRetData;
|
||||
procedure FreeReturnData;
|
||||
|
||||
procedure GetDimensions(var W, H: Integer);
|
||||
procedure GetDimensions(out W, H: Integer);
|
||||
procedure GetPosition(var Left, Top: Integer);
|
||||
procedure ActivateClient;
|
||||
|
||||
@ -612,7 +612,7 @@ begin
|
||||
result := (keymouse.TargetValid and image.TargetValid);
|
||||
end;
|
||||
|
||||
procedure TIOManager_Abstract.GetDimensions(var W, H: Integer);
|
||||
procedure TIOManager_Abstract.GetDimensions(out W, H: Integer);
|
||||
begin
|
||||
image.GetTargetDimensions(w,h)
|
||||
end;
|
||||
@ -721,12 +721,12 @@ end;
|
||||
|
||||
//***implementation*** TTarget
|
||||
|
||||
procedure TTarget.GetTargetDimensions(var w, h: integer);
|
||||
procedure TTarget.GetTargetDimensions(out w, h: integer);
|
||||
begin
|
||||
raise Exception.Create('GetTargetDimensions not available for this target');
|
||||
end;
|
||||
|
||||
procedure TTarget.GetTargetPosition(var left, top: integer);
|
||||
procedure TTarget.GetTargetPosition(out left, top: integer);
|
||||
begin
|
||||
raise Exception.Create('GetTargetDimensions not available for this target');
|
||||
end;
|
||||
@ -754,7 +754,7 @@ begin
|
||||
result:= true;
|
||||
end;
|
||||
|
||||
procedure TTarget.GetMousePosition(var x,y: integer);
|
||||
procedure TTarget.GetMousePosition(out x,y: integer);
|
||||
begin
|
||||
raise Exception.Create('GetMousePosition not available for this target');
|
||||
end;
|
||||
@ -823,7 +823,7 @@ destructor TEIOS_Target.Destroy; begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TEIOS_Target.GetTargetDimensions(var w, h: integer);
|
||||
procedure TEIOS_Target.GetTargetDimensions(out w, h: integer);
|
||||
begin
|
||||
if Pointer(client.GetTargetDimensions) <> nil then
|
||||
client.GetTargetDimensions(target,w,h)
|
||||
@ -831,7 +831,7 @@ begin
|
||||
inherited GetTargetDimensions(w,h);
|
||||
end;
|
||||
|
||||
procedure TEIOS_Target.GetTargetPosition(var left, top: integer);
|
||||
procedure TEIOS_Target.GetTargetPosition(out left, top: integer);
|
||||
begin
|
||||
if Pointer(client.GetTargetDimensions) <> nil then
|
||||
client.GetTargetDimensions(target,left,top)
|
||||
@ -854,7 +854,7 @@ begin
|
||||
Inc(result.Ptr, ys * result.RowLen + xs);
|
||||
end;
|
||||
|
||||
procedure TEIOS_Target.GetMousePosition(var x,y: integer);
|
||||
procedure TEIOS_Target.GetMousePosition(out x,y: integer);
|
||||
begin
|
||||
if Pointer(client.GetMousePosition) <> nil then
|
||||
client.GetMousePosition(target,x,y)
|
||||
@ -974,13 +974,13 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TRawTarget.GetTargetDimensions(var w, h: integer);
|
||||
procedure TRawTarget.GetTargetDimensions(out w, h: integer);
|
||||
begin
|
||||
w:= self.w;
|
||||
h:= self.h;
|
||||
end;
|
||||
|
||||
procedure TRawTarget.GetTargetPosition(var left, top: integer);
|
||||
procedure TRawTarget.GetTargetPosition(out left, top: integer);
|
||||
begin
|
||||
{ The RawTarget has no position on the screen }
|
||||
left := 0;
|
||||
@ -1008,7 +1008,7 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TBitmapTarget.GetTargetDimensions(var w, h: integer);
|
||||
procedure TBitmapTarget.GetTargetDimensions(out w, h: integer);
|
||||
begin
|
||||
h:= bitmap.Height;
|
||||
w:= bitmap.Width;
|
||||
|
@ -37,7 +37,7 @@ interface
|
||||
implementation
|
||||
|
||||
uses
|
||||
MufasaTypes,MufasaBase,FileUtil, strutils;
|
||||
MufasaTypes,MufasaBase,FileUtil;
|
||||
|
||||
procedure TGenericLoader.AddPath(path: string);
|
||||
var
|
||||
|
@ -3,10 +3,10 @@ unit mufasabase;
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
{$undefine mDebug}
|
||||
{$undef mDebug}
|
||||
|
||||
uses
|
||||
files, Classes, SysUtils{$ifdef MSWindows},windows{$endif};
|
||||
Classes, SysUtils{$ifdef MSWindows},windows{$endif};
|
||||
|
||||
procedure mDebugLn( s : string);overload;
|
||||
procedure mDebugLn( s : string; f : array of const);overload;
|
||||
|
@ -26,7 +26,7 @@ unit os_linux;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, mufasatypes, xlib, x, xutil, IOManager, XKeyInput, ctypes, xtest, keysym,
|
||||
Classes, SysUtils, mufasatypes, xlib, x, xutil, IOManager, XKeyInput, ctypes, xtest,
|
||||
syncobjs, mufasabase;
|
||||
|
||||
type
|
||||
@ -45,8 +45,8 @@ interface
|
||||
public
|
||||
constructor Create(display: PDisplay; screennum: integer; window: x.TWindow);
|
||||
destructor Destroy; override;
|
||||
procedure GetTargetDimensions(var w, h: integer); override;
|
||||
procedure GetTargetPosition(var left, top: integer); override;
|
||||
procedure GetTargetDimensions(out w, h: integer); override;
|
||||
procedure GetTargetPosition(out left, top: integer); override;
|
||||
function ReturnData(xs, ys, width, height: Integer): TRetData; override;
|
||||
procedure FreeReturnData; override;
|
||||
|
||||
@ -56,7 +56,7 @@ interface
|
||||
|
||||
function TargetValid: boolean; override;
|
||||
procedure ActivateClient; override;
|
||||
procedure GetMousePosition(var x,y: integer); override;
|
||||
procedure GetMousePosition(out x,y: integer); override;
|
||||
procedure MoveMouse(x,y: integer); override;
|
||||
procedure HoldMouse(x,y: integer; button: TClickType); override;
|
||||
procedure ReleaseMouse(x,y: integer; button: TClickType); override;
|
||||
@ -256,11 +256,9 @@ implementation
|
||||
result := self.window;
|
||||
end;
|
||||
|
||||
procedure TWindow.GetTargetDimensions(var w, h: integer);
|
||||
procedure TWindow.GetTargetDimensions(out w, h: integer);
|
||||
var
|
||||
Attrib: TXWindowAttributes;
|
||||
newx, newy: integer;
|
||||
childwindow: x.TWindow;
|
||||
begin
|
||||
if XGetWindowAttributes(display, window, @Attrib) <> 0 Then
|
||||
begin
|
||||
@ -273,11 +271,9 @@ implementation
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWindow.GetTargetPosition(var left, top: integer);
|
||||
procedure TWindow.GetTargetPosition(out left, top: integer);
|
||||
var
|
||||
Attrib: TXWindowAttributes;
|
||||
newx, newy: integer;
|
||||
childwindow: x.TWindow;
|
||||
begin
|
||||
if XGetWindowAttributes(display, window, @Attrib) <> 0 Then
|
||||
begin
|
||||
@ -350,7 +346,7 @@ implementation
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWindow.GetMousePosition(var x,y: integer);
|
||||
procedure TWindow.GetMousePosition(out x,y: integer);
|
||||
var
|
||||
b:integer;
|
||||
root, child: twindow;
|
||||
@ -510,7 +506,7 @@ implementation
|
||||
|
||||
function TIOManager.SetTarget(target: x.TWindow): integer;
|
||||
begin
|
||||
SetBothTargets(TWindow.Create(display, screennum, target))
|
||||
result := SetBothTargets(TWindow.Create(display, screennum, target))
|
||||
end;
|
||||
|
||||
function TIOManager.GetProcesses: TSysProcArr;
|
||||
|
@ -98,7 +98,7 @@ procedure OffsetATPA(var ATPA : T2DPointArray; const Offset : TPoint);
|
||||
implementation
|
||||
|
||||
uses
|
||||
math,mmath;
|
||||
math;
|
||||
|
||||
|
||||
|
||||
@ -205,11 +205,11 @@ begin
|
||||
if Lo < iHi then QuickSort(A, Lo, iHi) ;
|
||||
end;
|
||||
|
||||
const
|
||||
{const
|
||||
flnC=545947;
|
||||
fsqrtA:single=0.5;
|
||||
|
||||
{{$ASMMODE INTEL}
|
||||
{$ASMMODE INTEL}
|
||||
function fsqrt(x: Single): Single;
|
||||
begin
|
||||
asm
|
||||
|
Loading…
Reference in New Issue
Block a user