Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hakakou committed Feb 16, 2020
1 parent b9b81eb commit ab1d53a
Show file tree
Hide file tree
Showing 1,991 changed files with 913,394 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.map
*.~*
LibraryPrivate
Output
Binary file added Bin/Assorted.bpl
Binary file not shown.
Binary file added Bin/Assorted.dcp
Binary file not shown.
Binary file added Bin/DIPcre_D7.bpl
Binary file not shown.
Binary file added Bin/DIPcre_D7.dcp
Binary file not shown.
Binary file added Bin/DJCL70.bpl
Binary file not shown.
Binary file added Bin/DJCL70.dcp
Binary file not shown.
Binary file added Bin/DragDropD5.bpl
Binary file not shown.
Binary file added Bin/DragDropD5.dcp
Binary file not shown.
Binary file added Bin/HKComponents.bpl
Binary file not shown.
Binary file added Bin/HKComponents.dcp
Binary file not shown.
Binary file added Bin/JVCL200_D70.bpl
Binary file not shown.
Binary file added Bin/JVCL200_D70.dcp
Binary file not shown.
Binary file added Bin/JVCL200_R70.bpl
Binary file not shown.
Binary file added Bin/JVCL200_R70.dcp
Binary file not shown.
Binary file added Bin/VirtualExplorerListviewExD7.bpl
Binary file not shown.
Binary file added Bin/VirtualExplorerListviewExD7.dcp
Binary file not shown.
Binary file added Bin/VirtualExplorerListviewExD7D.bpl
Binary file not shown.
Binary file added Bin/VirtualExplorerListviewExD7D.dcp
Binary file not shown.
Binary file added Bin/VirtualShellToolsD7.bpl
Binary file not shown.
Binary file added Bin/VirtualShellToolsD7.dcp
Binary file not shown.
Binary file added Bin/VirtualShellToolsD7D.bpl
Binary file not shown.
Binary file added Bin/VirtualShellToolsD7D.dcp
Binary file not shown.
Binary file added Bin/VirtualTreesD7.bpl
Binary file not shown.
Binary file added Bin/VirtualTreesD7.dcp
Binary file not shown.
Binary file added Bin/VirtualTreesD7D.bpl
Binary file not shown.
Binary file added Bin/VirtualTreesD7D.dcp
Binary file not shown.
Binary file added Bin/aqDockingManagerD7.bpl
Binary file not shown.
Binary file added Bin/aqDockingManagerD7.dcp
Binary file not shown.
Binary file added Bin/dcctd7.bpl
Binary file not shown.
Binary file added Bin/dcctd7.dcp
Binary file not shown.
Binary file added Bin/dclaqDockingManagerD7.bpl
Binary file not shown.
Binary file added Bin/dclaqDockingManagerD7.dcp
Binary file not shown.
Binary file added Bin/dcldxBarD7.bpl
Binary file not shown.
Binary file added Bin/dcldxBarD7.dcp
Binary file not shown.
Binary file added Bin/dcldxBarDBNavD7.bpl
Binary file not shown.
Binary file added Bin/dcldxBarDBNavD7.dcp
Binary file not shown.
Binary file added Bin/dcldxBarExtDBItemsD7.bpl
Binary file not shown.
Binary file added Bin/dcldxBarExtDBItemsD7.dcp
Binary file not shown.
Binary file added Bin/dcldxBarExtItemsD7.bpl
Binary file not shown.
Binary file added Bin/dcldxBarExtItemsD7.dcp
Binary file not shown.
Binary file added Bin/dcldxForumLibD7.bpl
Binary file not shown.
Binary file added Bin/dcldxForumLibD7.dcp
Binary file not shown.
Binary file added Bin/dcldxsbD7.bpl
Binary file not shown.
Binary file added Bin/dcldxsbD7.dcp
Binary file not shown.
Binary file added Bin/dxBarD7.bpl
Binary file not shown.
Binary file added Bin/dxBarD7.dcp
Binary file not shown.
Binary file added Bin/dxBarDBNavD7.bpl
Binary file not shown.
Binary file added Bin/dxBarDBNavD7.dcp
Binary file not shown.
Binary file added Bin/dxBarExtDBItemsD7.bpl
Binary file not shown.
Binary file added Bin/dxBarExtDBItemsD7.dcp
Binary file not shown.
Binary file added Bin/dxBarExtItemsD7.bpl
Binary file not shown.
Binary file added Bin/dxBarExtItemsD7.dcp
Binary file not shown.
Binary file added Bin/dxComnD7.bpl
Binary file not shown.
Binary file added Bin/dxComnD7.dcp
Binary file not shown.
Binary file added Bin/dxsbD7.bpl
Binary file not shown.
Binary file added Bin/dxsbD7.dcp
Binary file not shown.
Binary file added Bin/ehs_d7.bpl
Binary file not shown.
Binary file added Bin/ehs_d7.dcp
Binary file not shown.
Binary file added Bin/kbmMemD7Des.bpl
Binary file not shown.
Binary file added Bin/kbmMemD7Des.dcp
Binary file not shown.
Binary file added Bin/kbmMemD7Run.bpl
Binary file not shown.
Binary file added Bin/kbmMemD7Run.dcp
Binary file not shown.
Binary file added Bin/zip.bpl
Binary file not shown.
Binary file added Bin/zip.dcp
Binary file not shown.
23 changes: 23 additions & 0 deletions Client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.exe
*.dll
*.bpl
*.bpi
*.dcp
*.so
*.apk
*.drc
*.dres
*.rsm
*.tds
*.dcu
*.lib
*.a
*.o
*.ocx
*.hpp
*Resource.rc
*.local
*.identcache
*.projdata
*.tvsconfig
*.dsk
198 changes: 198 additions & 0 deletions Client/AutoClient.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
unit AutoClient;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses
SysUtils, ComObj, ActiveX, AxCtrls, Classes, OptiClient_TLB, StdVcl, ComServ, PerlAPI, ClientFrm,
PlugCommon, Windows, Forms, ExtCtrls, OptiPerl_TLB;

type
TOptiPerlClient = class(TAutoObject, IOptiPerlClient)
private
procedure OnIdle(Sender: TObject; var Done: Boolean);
Procedure OnTimer(Sender: TObject);
public
PArray : TPcharArray;
Timer : TTimer;
OptiPerl : IApplication;
procedure Initialize; override;
Destructor Destroy; Override;
protected
procedure Start; safecall;
procedure InitOptions(const PerlDLL: WideString; MainHandle: Integer;
const Filename: WideString; PlugNum: Integer); safecall;
function Get_Subroutines: WideString; safecall;
function RunInt0(const Sub: WideString): Integer; safecall;
function RunInt1(const Sub, P1: WideString): Integer; safecall;
procedure RunSub0(const Sub: WideString); safecall;
procedure RunSub1(const Sub, P1: WideString); safecall;
procedure RunSub2(const Sub, P1, P2: WideString); safecall;
procedure DockWindow(Handle, Parent: Integer); safecall;
procedure Grab(Enable: WordBool; Handle: Integer); safecall;
function Get_FirstEnabledWindow: Integer; safecall;
function Get_ProcessID: Integer; safecall;
function RunInt2(const Sub, P1, P2: WideString): Integer; safecall;
end;

var
MainFormHandle : THandle;
PlugAction : Cardinal;
Perl : TPerlEvents;

implementation

procedure TOptiPerlClient.Initialize;
begin
ClientForm.TerminateTimer.Enabled:=false;
inherited Initialize;
end;

procedure TOptiPerlClient.OnIdle(Sender: TObject; var Done: Boolean);
begin
perl.TKDoEventWait;
end;

procedure TOptiPerlClient.Start;
begin
Perl.Initialize;
Forms.Application.OnIdle:=OnIdle;
end;

destructor TOptiPerlClient.Destroy;
begin
if assigned(Timer) then
FreeAndNil(Timer);
if assigned(perl) then
FreeAndNil(Perl);
PostMessage(MainFormHandle,HK_P_Terminate,PlugAction,0);
inherited Destroy;
end;

procedure TOptiPerlClient.InitOptions(const PerlDLL: WideString;
MainHandle: Integer; const Filename: WideString; PlugNum: Integer);
begin
PerlApi.PerlDllFile:=PerlDLL;
MainFormHandle:=MainHandle;
ClientForm.Caption:=Filename;
PlugAction:=PlugNum;
Perl:=TPerlEvents.Create(FileName);
Perl.MainHandle:=MainHandle;
perl.SelfStr:=IntToStr(plugAction);
Perl.RaiseExceptions:=true;
perl.Debug:=true;
Perl.UseTK:=true;
end;

function TOptiPerlClient.Get_Subroutines: WideString;
begin
result:=perl.Subroutines.Text;
end;

function TOptiPerlClient.RunInt0(const Sub: WideString): Integer;
begin
result:=Perl.RunIntFunction(sub,nil);
end;

function TOptiPerlClient.RunInt1(const Sub, P1: WideString): Integer;
begin
PArray[0]:=PChar(String(p1));
PArray[1]:=nil;
result:=Perl.RunIntFunction(sub,@PArray);
end;

function TOptiPerlClient.RunInt2(const Sub, P1, P2: WideString): Integer;
begin
PArray[0]:=PChar(String(p1));
PArray[1]:=PChar(String(p2));
PArray[2]:=nil;
result:=Perl.RunIntFunction(sub,@PArray);
end;

procedure TOptiPerlClient.RunSub0(const Sub: WideString);
begin
Perl.RunSubroutine(sub,nil);
end;

procedure TOptiPerlClient.RunSub1(const Sub, P1: WideString);
begin
PArray[0]:=PAnsiChar(String(p1));
PArray[1]:=nil;
Perl.RunSubroutine(sub,@PArray);
end;

procedure TOptiPerlClient.RunSub2(const Sub, P1, P2: WideString);
begin
PArray[0]:=PAnsiChar(String(p1));
PArray[1]:=PAnsiChar(String(p2));
PArray[2]:=nil;
Perl.RunSubroutine(sub,@PArray);
end;

procedure TOptiPerlClient.DockWindow(Handle, Parent: Integer);
var rect : Trect;
begin
SetWindowLong(Handle,GWL_STYLE,WS_VISIBLE);
perl.TKDoEvent;
GetWindowRect(Handle,Rect);
with rect do
SetWindowPos(Handle,0,0,0,right-left+1,bottom-top+1,SWP_NOACTIVATE or SWP_NOZORDER);
SetParent(handle,parent);
Perl.TKDoEvent;
end;

procedure TOptiPerlClient.Grab(Enable: WordBool; Handle: Integer);
begin
OptiPerl:=CoApplication.Create;
if Enable then
begin
Timer:=TTimer.Create(nil);
Timer.OnTimer:=OnTimer;
Timer.Interval:=50;
end
else
FreeAndNil(Timer);
end;

procedure TOptiPerlClient.OnTimer(Sender: TObject);
begin
try
if assigned(OptiPerl) then
OptiPerl.ProcessMessages;
except
halt;
end;
end;

Function EnumThreadWndProc(Hwnd : THandle; LParam : Cardinal) : Boolean; Stdcall;
var H : ^THandle;
begin
if IsWindowEnabled(Hwnd) and
isWindowVisible(hwnd) and
(hwnd<>Forms.Application.MainForm.Handle) then
begin
H:=pointer(LParam);
h^:=hwnd;
result:=false;
end
else
result:=true;
end;

function TOptiPerlClient.Get_FirstEnabledWindow: Integer;
begin
result:=0;
EnumThreadWindows(GetCurrentThreadID,@EnumThreadWndProc,Integer(@result));
end;

function TOptiPerlClient.Get_ProcessID: Integer;
begin
result:=GetCurrentProcessID;
end;


initialization
TAutoObjectFactory.Create(ComServer, TOptiPerlClient, Class_OptiPerlClient,
ciSingleInstance, tmSingle);
end.
Binary file added Client/ClientFrm.ddp
Binary file not shown.
23 changes: 23 additions & 0 deletions Client/ClientFrm.dfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
object ClientForm: TClientForm
Left = 591
Top = 297
BorderStyle = bsDialog
Caption = 'ClientForm'
ClientHeight = 74
ClientWidth = 192
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object TerminateTimer: TTimer
Interval = 3000
OnTimer = TerminateTimerTimer
Left = 40
Top = 16
end
end
31 changes: 31 additions & 0 deletions Client/ClientFrm.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
unit ClientFrm;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
ExtCtrls;

type
TClientForm = class(TForm)
TerminateTimer: TTimer;
procedure TerminateTimerTimer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
ClientForm: TClientForm;

implementation

{$R *.dfm}

procedure TClientForm.TerminateTimerTimer(Sender: TObject);
begin
Application.Terminate;
end;

end.
23 changes: 23 additions & 0 deletions Client/ClientTest.bpg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#------------------------------------------------------------------------------
VERSION = BWS.01
#------------------------------------------------------------------------------
!ifndef ROOT
ROOT = $(MAKEDIR)\..
!endif
#------------------------------------------------------------------------------
MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
DCC = $(ROOT)\bin\dcc32.exe $**
BRCC = $(ROOT)\bin\brcc32.exe $**
#------------------------------------------------------------------------------
PROJECTS = OptiClient.exe OleTest.exe
#------------------------------------------------------------------------------
default: $(PROJECTS)
#------------------------------------------------------------------------------

OptiClient.exe: OptiClient.dpr
$(DCC)

OleTest.exe: Test\OleTest.dpr
$(DCC)


40 changes: 40 additions & 0 deletions Client/OptiClient.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
-$A8
-$B-
-$C-
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J-
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-GD
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-E"c:\OptiPerl\exe\"
-LE"c:\OptiPerl\Bin\"
-LN"c:\OptiPerl\Bin\"
-w-UNSAFE_TYPE
-w-UNSAFE_CODE
-w-UNSAFE_CAST
Loading

0 comments on commit ab1d53a

Please sign in to comment.