aboutsummaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJuha Vehviläinen <jusu@users.sourceforge.net>2002-09-18 16:32:27 +0000
committerJuha Vehviläinen <jusu@users.sourceforge.net>2002-09-18 16:32:27 +0000
commit3bd43c9d18e565e193e555f9de0ce916f8faf807 (patch)
tree81b3938b9863edf96efa6e0b1adf33081da5f440 /Source
parentabe3e28bb8c11236f42046e1c1fd6f809b00a823 (diff)
*** empty log message ***
svn path=/trunk/Framestein/; revision=132
Diffstat (limited to 'Source')
-rw-r--r--Source/Framestein.cfg10
-rw-r--r--Source/Framestein.dof34
-rw-r--r--Source/Framestein.dpr41
-rw-r--r--Source/Framestein.resbin4056 -> 6980 bytes
-rw-r--r--Source/configureunit.dfm61
-rw-r--r--Source/configureunit.pas30
-rw-r--r--Source/fscopyunit.pas23
-rw-r--r--Source/fsframeunit.pas13
-rw-r--r--Source/mainunit.pas52
-rw-r--r--Source/pluginunit.pas36
-rw-r--r--Source/pshostunit.pas7
11 files changed, 210 insertions, 97 deletions
diff --git a/Source/Framestein.cfg b/Source/Framestein.cfg
index dc72219..6ee2f15 100644
--- a/Source/Framestein.cfg
+++ b/Source/Framestein.cfg
@@ -6,7 +6,7 @@
-$F-
-$G+
-$H+
--$I+
+-$I-
-$J+
-$K-
-$L+
@@ -33,7 +33,7 @@
-K$00400000
-LE"c:\program files\borland\delphi5\Projects\Bpl"
-LN"c:\program files\borland\delphi5\Projects\Bpl"
--U"g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib"
--O"g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib"
--I"g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib"
--R"g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib"
+-U"E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32"
+-O"E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32"
+-I"E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32"
+-R"E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32"
diff --git a/Source/Framestein.dof b/Source/Framestein.dof
index d2d8419..ddd0c6f 100644
--- a/Source/Framestein.dof
+++ b/Source/Framestein.dof
@@ -7,7 +7,7 @@ E=0
F=0
G=1
H=1
-I=1
+I=0
J=1
K=0
L=1
@@ -43,8 +43,8 @@ OutputDir=
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
-SearchPath=g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib
-Packages=Vcl50;Vclx50;VclSmp50;Qrpt50;Vcldb50;Vclbde50;ibevnt50;vcldbx50;TeeUI50;TeeDB50;Tee50;TeeQR50;VCLIB50;vclie50;Inetdb50;Inet50;NMFast50;dclocx50;dclaxserver50;temppak;janDrawPack;pdpak
+SearchPath=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32
+Packages=Vcl50;Vclx50;VclSmp50;Qrpt50;Vcldb50;Vclbde50;ibevnt50;vcldbx50;TeeUI50;TeeDB50;Tee50;TeeQR50;VCLIB50;vclie50;Inetdb50;Inet50;NMFast50;dclocx50;dclaxserver50;DelphiX_for5;fspak
Conditionals=
DebugSourceDirs=
UsePackages=0
@@ -56,33 +56,37 @@ ActiveLang=
ProjectLang=$0000040B
RootDir=
[Version Info]
-IncludeVerInfo=1
-AutoIncBuild=1
-MajorVer=0
-MinorVer=1
-Release=1
-Build=79
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
Debug=0
-PreRelease=1
+PreRelease=0
Special=0
Private=0
DLL=0
-Locale=1033
+Locale=1035
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
-FileVersion=0.1.1.79
+FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
-ProductName=Framestein
+ProductName=
ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib
+Count=5
+Item0=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32
+Item1=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32\Packages
+Item2=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost
+Item3=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib
+Item4=E:\lab\common\DelphiX2000_0717-2\Source
diff --git a/Source/Framestein.dpr b/Source/Framestein.dpr
index 4dd00b2..f280e75 100644
--- a/Source/Framestein.dpr
+++ b/Source/Framestein.dpr
@@ -1,35 +1,23 @@
-{ Copyright (C) 2001-2002 Juha Vehviläinen
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.}
-
program Framestein;
-{%ToDo 'Framestein.todo'}
-
uses
+ ActiveX,
Forms,
mainunit in 'mainunit.pas' {main},
- fsframeunit in 'fsframeunit.pas' {fsframe},
+ pshostunit in 'pshostunit.pas',
+ effectsunit in 'effectsunit.pas',
+ fsaviunit in 'fsaviunit.pas' {FsAvi},
+ fsbrowserunit in 'fsbrowserunit.pas',
fscopyunit in 'fscopyunit.pas' {fscopy},
- fstextunit in 'fstextunit.pas' {fstext},
- fsformunit in 'fsformunit.pas',
fsdrawunit in 'fsdrawunit.pas' {fsdraw},
- effectsunit in 'effectsunit.pas',
- pluginunit in 'pluginunit.pas',
- logunit in 'logunit.pas' {log},
- fsbrowserunit in 'fsbrowserunit.pas' {fsbrowser},
+ fsformunit in 'fsformunit.pas',
+ fsframeunit in 'fsframeunit.pas' {fsframe},
fsinfounit in 'fsinfounit.pas' {fsinfo},
- configureunit in 'configureunit.pas' {configure},
- pshostunit in 'pshostunit.pas',
- fsaviunit in 'fsaviunit.pas' {FsAvi},
- progressunit in 'progressunit.pas' {Progress};
+ fstextunit in 'fstextunit.pas' {fstext},
+ logunit in 'logunit.pas' {log},
+ pluginunit in 'pluginunit.pas',
+ progressunit in 'progressunit.pas' {Progress},
+ configureunit in 'configureunit.pas' {configure};
{$R *.RES}
@@ -37,10 +25,9 @@ begin
Application.Initialize;
Application.Title := 'Framestein';
Application.CreateForm(Tmain, main);
- Application.CreateForm(Tlog, log);
- Application.CreateForm(Tconfigure, configure);
- Application.CreateForm(TFsAvi, FsAvi);
Application.CreateForm(TProgress, Progress);
+ Application.CreateForm(Tconfigure, configure);
+ Application.CreateForm(Tlog, log);
Application.Run;
end.
diff --git a/Source/Framestein.res b/Source/Framestein.res
index 6b96418..62620b9 100644
--- a/Source/Framestein.res
+++ b/Source/Framestein.res
Binary files differ
diff --git a/Source/configureunit.dfm b/Source/configureunit.dfm
index 5a9e46d..f171463 100644
--- a/Source/configureunit.dfm
+++ b/Source/configureunit.dfm
@@ -21,9 +21,62 @@ object configure: Tconfigure
Top = 0
Width = 427
Height = 275
- ActivePage = TSConnections
+ ActivePage = TSFolders
Align = alClient
TabOrder = 0
+ object TSFolders: TTabSheet
+ Caption = 'Folders'
+ ImageIndex = 2
+ object Label6: TLabel
+ Left = 16
+ Top = 36
+ Width = 83
+ Height = 13
+ Caption = 'Framestein folder:'
+ end
+ object EditFSFolder: TEdit
+ Left = 152
+ Top = 32
+ Width = 225
+ Height = 21
+ Ctl3D = True
+ ParentCtl3D = False
+ TabOrder = 0
+ Text = 'E:\'
+ end
+ object Memo1: TMemo
+ Left = 16
+ Top = 200
+ Width = 389
+ Height = 33
+ BorderStyle = bsNone
+ Enabled = False
+ Lines.Strings = (
+
+ 'Choose the folder where Framestein will find its Plugins and Fil' +
+ 'ters.'
+ '')
+ ReadOnly = True
+ TabOrder = 1
+ end
+ object DirectoryListBox1: TDirectoryListBox
+ Left = 152
+ Top = 88
+ Width = 225
+ Height = 97
+ ItemHeight = 16
+ TabOrder = 2
+ OnChange = DirectoryListBox1Change
+ end
+ object DriveComboBox1: TDriveComboBox
+ Left = 152
+ Top = 64
+ Width = 225
+ Height = 19
+ TabOrder = 3
+ OnChange = DriveComboBox1Change
+ end
+ end
object TSConnections: TTabSheet
Caption = 'Connections'
object Label1: TLabel
@@ -116,7 +169,7 @@ object configure: Tconfigure
Caption = 'General'
ImageIndex = 1
object CBDockMain: TCheckBox
- Left = 16
+ Left = 26
Top = 36
Width = 377
Height = 17
@@ -134,7 +187,7 @@ object configure: Tconfigure
BevelOuter = bvNone
TabOrder = 1
object ButtonOk: TButton
- Left = 8
+ Left = 344
Top = 8
Width = 75
Height = 25
@@ -144,7 +197,7 @@ object configure: Tconfigure
OnClick = ButtonOkClick
end
object ButtonCancel: TButton
- Left = 96
+ Left = 256
Top = 8
Width = 75
Height = 25
diff --git a/Source/configureunit.pas b/Source/configureunit.pas
index 88dff73..b4a1dab 100644
--- a/Source/configureunit.pas
+++ b/Source/configureunit.pas
@@ -4,7 +4,7 @@ interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls, ComCtrls;
+ StdCtrls, ExtCtrls, ComCtrls, Buttons, FileCtrl;
type
Tconfigure = class(TForm)
@@ -25,9 +25,17 @@ type
CBEnableFSConns: TCheckBox;
TSGeneral: TTabSheet;
CBDockMain: TCheckBox;
+ TSFolders: TTabSheet;
+ Label6: TLabel;
+ EditFSFolder: TEdit;
+ Memo1: TMemo;
+ DirectoryListBox1: TDirectoryListBox;
+ DriveComboBox1: TDriveComboBox;
procedure ButtonCancelClick(Sender: TObject);
procedure ButtonOkClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
+ procedure DriveComboBox1Change(Sender: TObject);
+ procedure DirectoryListBox1Change(Sender: TObject);
private
{ Private declarations }
public
@@ -59,6 +67,12 @@ begin
main.FSPort := StrToInt(EditFsPort.Text);
main.EnableFSConns := CBEnableFSConns.Checked;
main.DockMain := CBDockMain.Checked;
+ if main.FSFolder <> EditFSFolder.Text then begin
+ main.FSFolder := EditFSFolder.Text;
+ main.Plugins.Clear;
+ main.Plugins.ReLoad;
+ main.SearchPath.Add(main.FSFolder);
+ end;
try
if Reg.OpenKey('\Software\Framestein', True) then begin
@@ -68,6 +82,7 @@ begin
Reg.WriteInteger('FSPort', main.FSPort);
Reg.WriteBool('EnableFSConns', main.EnableFSConns);
Reg.WriteBool('DockMain', main.DockMain);
+ Reg.WriteString('FSFolder', main.FSFolder);
end;
except
end;
@@ -106,6 +121,7 @@ begin
EditFsPort.Text := IntToStr(main.FSPort);
CBEnableFSConns.Checked := main.EnableFSConns;
CBDockMain.Checked := main.DockMain;
+ EditFSFolder.Text := main.FSFolder;
// show
ShowModal;
end;
@@ -116,5 +132,17 @@ begin
Execute;
end;
+procedure Tconfigure.DriveComboBox1Change(Sender: TObject);
+begin
+ DirectoryListBox1.Drive :=
+ (Sender as TDriveComboBox).Drive;
+end;
+
+procedure Tconfigure.DirectoryListBox1Change(Sender: TObject);
+begin
+ EditFSFolder.Text :=
+ (Sender as TDirectoryListBox).Directory;
+end;
+
end.
diff --git a/Source/fscopyunit.pas b/Source/fscopyunit.pas
index 0206d8f..72ab627 100644
--- a/Source/fscopyunit.pas
+++ b/Source/fscopyunit.pas
@@ -37,7 +37,9 @@ type
iAlpha, iAdd, iSub: Integer;
iBlend: Extended;
Transparent, MirrorLeftRight, MirrorUpdown: Boolean;
- iPlugin, iPluginArgs: String;
+ TransColor: Cardinal;
+ iPlugin: Integer;
+ iPluginArgs: String;
iFilter, iFilterArgs: String;
procedure GetFrames(const S: String);
@@ -101,6 +103,7 @@ var
df: TDDBltFX;
ddck: TDDColorKey;
sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2: Integer;
+ r, g, b: Byte;
begin
if (S='') then Exit;
@@ -165,13 +168,19 @@ begin
if s1='TRANSPARENT_0' then begin Transparent := False; Exit; end else
if s1='TRANSPARENT_1' then begin Transparent := True; Exit; end else
+ if s1='TRANSCOLOR' then begin
+ r := MyStrToInt(ExtractWord(2, S, [' ']));
+ g := MyStrToInt(ExtractWord(3, S, [' ']));
+ b := MyStrToInt(ExtractWord(4, S, [' ']));
+ TransColor := RGB(r, g, b);
+ Exit;
+ end else
if s1='MIRRORLEFTRIGHT_0' then begin MirrorLeftRight := False; Exit; end else
if s1='MIRRORLEFTRIGHT_1' then begin MirrorLeftRight := True; Exit; end else
if s1='MIRRORUPDOWN_0' then begin MirrorUpDown := False; Exit; end else
if s1='MIRRORUPDOWN_1' then begin MirrorUpDown := True; Exit; end else
- if main.Plugins.IsPlugin(s1) then begin
+ if main.Plugins.IsPlugin(iPlugin, s1) then begin
DrawStyle := dsPlugin;
- iPlugin := s1;
iPluginArgs := Copy(S, Length(s1)+2, 255);
Exit;
end else
@@ -182,7 +191,6 @@ begin
Exit;
end;
-
GetFrames(S);
if (f1=nil) or (f2=nil) then Exit;
if (f1.d1=nil) or (f2.d1=nil) then Exit;
@@ -257,15 +265,15 @@ begin
case DrawStyle of
dsCopy: begin
- ddck.dwColorSpaceLowValue := 0;
- ddck.dwColorSpaceHighValue := 0;
+ ddck.dwColorSpaceLowValue := TransColor;
+ ddck.dwColorSpaceHighValue := TransColor;
DF.dwsize := SizeOf(DF);
DF.dwROP := cmSrcCopy;
DF.dwDDFX := 0;
DF.ddckSrcColorkey := ddck;
DF.ddckDestColorkey := ddck;
bltFlags := DDBLT_DDFX;
- if Transparent then bltFlags := bltFlags or DDBLT_KEYSRCOVERRIDE;
+ if Transparent then bltFlags := bltFlags or DDBLT_KEYSRCOVERRIDE;//OVERRIDE;
if MirrorLeftRight then
DF.dwDDFX := DF.dwDDFX or DDBLTFX_MIRRORLEFTRIGHT;
if MirrorUpDown then
@@ -341,6 +349,7 @@ begin
DestType := rtAll;
iAlpha := 50; iAdd := 255; iSub := 255;
Transparent := False;
+ TransColor := 0;
MirrorLeftRight := False;
MirrorUpDown := False;
end;
diff --git a/Source/fsframeunit.pas b/Source/fsframeunit.pas
index e3316a7..449d8fc 100644
--- a/Source/fsframeunit.pas
+++ b/Source/fsframeunit.pas
@@ -1,4 +1,4 @@
-{ Copyright (C) 2001 Juha Vehviläinen
+{ Copyright (C) 2001-2002 Juha Vehviläinen
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
@@ -646,10 +646,14 @@ begin
ExtractWord(4, s1, [' ']) // caption
);
end else
+ if s1='TITLE' then begin
+ s1 := Copy(S, Length(s1)+2, 255);
+ Caption := s1;
+ end else
if False{your new effect here} then begin
end else
- if main.Plugins.IsPlugin(s1) then begin
- if main.Plugins.CallEffect(d1.Surface, s1, Copy(S, Length(s1)+2, 255)) then
+ if main.Plugins.IsPlugin(i, s1) then begin
+ if main.Plugins.CallEffect(d1.Surface, i, Copy(S, Length(s1)+2, 255)) then
FlipRequest;
end else
if pshostunit.IsFilter(s1) then begin
@@ -954,9 +958,6 @@ begin
end;
procedure Tfsframe.HandleDroppedFile(const S: String);
-var
- i: Integer;
- St: String;
begin
Parse(S);
main.SendReturnValues(PdName+'bang=1');
diff --git a/Source/mainunit.pas b/Source/mainunit.pas
index 2cb7500..8a4a495 100644
--- a/Source/mainunit.pas
+++ b/Source/mainunit.pas
@@ -74,9 +74,9 @@ type
function ItemCount( const ClassName: String ): Integer;
procedure Reset;
procedure minimizeall;
- procedure ExceptionHandler(Sender: TObject; E: Exception);
procedure DropFileHandler(const h: HWND; const DroppedFileName: String);
procedure AppMessage(var Msg: Tmsg; var Handled: Boolean);
+ procedure ExceptionHandler(Sender: TObject; E: Exception);
public
{ Public declarations }
RunConfig: Boolean;
@@ -89,6 +89,7 @@ type
logstate: Boolean;
Plugins: TPlugins;
SearchPath: TStringList;
+ FSFolder: String;
function CompName(const S: String): String;
procedure Parse(const S: String); override;
@@ -102,9 +103,20 @@ type
function FileExistsInSearchPath(var S: String): Boolean; // modifying S allowed!
end;
+{$IFDEF FSDLL}
+ TMainThread = class(TThread)
+ public
+ procedure Execute; override;
+ end;
+{$ENDIF}
+
const
- STARTMSG = 'Framestein 0.31 running...';
- MCAPTION = 'Framestein 0.31';
+{$IFDEF FSDLL}
+ STARTMSG = 'FramesteinLib 0.32 DLL TEST 1 running...';
+{$ELSE}
+ STARTMSG = 'Framestein 0.32 dev running...';
+{$ENDIF}
+ MCAPTION = 'Framestein 0.32';
SocketBufferSize = 100000;
var
@@ -112,6 +124,10 @@ var
DockTitle: String;
DockHandle: HWND;
+{$IFDEF FSDLL}
+ MainT: TMainThread;
+{$ENDIF}
+
function WinEnumerator(h: HWND; i: LongInt): BOOL; stdcall;
function WinEnumerator_Exact(h: HWND; i: LongInt): BOOL; stdcall;
function WinEnumerator_SubStr(h: HWND; i: LongInt): BOOL; stdcall;
@@ -125,7 +141,23 @@ uses
fscopyunit, fstextunit, fsdrawunit, fsbrowserunit,
fsinfounit, fsaviunit,
fastfiles,
- Strz, logunit, configureunit;
+ Strz, logunit, configureunit, progressunit;
+
+{$IFDEF FSDLL}
+procedure TMainThread.Execute;
+begin
+ Application.Initialize;
+ Application.Title := '';
+ Application.CreateForm(Tmain, main);
+ Application.CreateForm(Tlog, log);
+ Application.CreateForm(Tconfigure, configure);
+ Application.CreateForm(TProgress, Progress);
+ Application.Run;
+// ???
+ Application.OnException := nil;
+ Application.OnMessage := nil;
+end;
+{$ENDIF}
function WinEnumerator(h: HWND; i: LongInt): BOOL; stdcall;
var
@@ -354,6 +386,7 @@ end;
procedure Tmain.FormCreate(Sender: TObject);
begin
+ FSFolder := ExtractFilePath(Application.Exename);
Randomize;
RunConfig:=False;
PdHost := 'localhost';
@@ -384,7 +417,7 @@ begin
logstate := False;
SearchPath := TStringList.Create;
- SearchPath.Add(ExtractFilePath(Application.ExeName));
+ SearchPath.Add(FSFolder);
Application.OnException := ExceptionHandler;
Application.OnMessage := AppMessage;
@@ -462,6 +495,9 @@ begin
FSPort := Reg.ReadInteger('FSPort');
EnableFSConns := Reg.ReadBool('EnableFSConns');
DockMain := Reg.ReadBool('DockMain');
+ FSFolder := Reg.ReadString('FSFolder');
+ if FSFolder='' then
+ FSFolder := ExtractFilePath(Application.Exename);
end;
except
RunConfig := True;
@@ -790,6 +826,8 @@ var
i: Integer;
f: TFsFrame;
begin
+ if main=nil then Exit;
+ with main do
if Pos('1400', E.Message)>0 then begin // invalid window handle
// check any fs.frames with invalid window handles
// (due to closing a patch with docked fs.frames)
@@ -897,6 +935,10 @@ begin
if main.ParentWindow<>0 then begin
main.ParentWindow:=0;
end;
+ Action := caFree;
+{$IFDEF FSDLL}
+ MainT.Terminate;
+{$ENDIF}
end;
end.
diff --git a/Source/pluginunit.pas b/Source/pluginunit.pas
index d4fd51e..e238f09 100644
--- a/Source/pluginunit.pas
+++ b/Source/pluginunit.pas
@@ -1,4 +1,4 @@
-{ Copyright (C) 2001 Juha Vehviläinen
+{ Copyright (C) 2001-2002 Juha Vehviläinen
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
@@ -49,12 +49,13 @@ type
procedure Load;
procedure Reload;
procedure Clear;
- function IsPlugin(const s: String): Boolean;
+ // IsPlugins sets Index if S is a plugin
+ function IsPlugin(var Index: Integer; const s: String): Boolean;
function CallEffect(const d: TDirectDrawSurface;
- const procname: String; const args: String): Boolean;
+ const procIndex: Integer; const args: String): Boolean;
function CallCopy(const d1: TDirectDrawSurface;
const d2: TDirectDrawSurface;
- const procname: String; const args: String): Boolean;
+ const procIndex: Integer; const args: String): Boolean;
end;
implementation
@@ -141,7 +142,7 @@ var
begin
sd := TScanDir.Create(Self);
sd.OnHandleFile := LoadHandleFile;
- sd.Scan(ExtractFilePath(Application.ExeName)+'\Plugins');
+ sd.Scan(main.FSFolder+'\Plugins');
sd.Free;
if Names.Count>0 then begin
s := '';
@@ -159,27 +160,25 @@ begin
Load;
end;
-function TPlugins.IsPlugin(const s: String): Boolean;
+function TPlugins.IsPlugin(var Index: Integer; const s: String): Boolean;
begin
- Result := Names.IndexOf(s)<>-1;
+ Index := Names.IndexOf(s);
+ Result := Index<>-1;
end;
var
argsBuf: array[0..255] of Char;
function TPlugins.CallEffect(const d: TDirectDrawSurface;
- const procname: String; const args: String): Boolean;
+ const procIndex: Integer; const args: String): Boolean;
var
- i: Integer;
Proc: TEffectProc;
sd: TDDSurfaceDesc;
P: PChar;
begin
Result := False;
- if (Names.Count=0) or (d.Width=0) or (d.Height=0) then Exit;
- i := Names.IndexOf(procname);
- if (i=-1) or (i>=EffectProcs.Count) then Exit;
- @Proc := EffectProcs[i];
+ if (procIndex=-1) or (procIndex>=EffectProcs.Count) then Exit;
+ @Proc := EffectProcs[procIndex];
if @Proc=nil then Exit;
P:=@argsBuf;
P[0]:=#0;
@@ -193,21 +192,16 @@ begin
end;
function TPlugins.CallCopy(const d1, d2: TDirectDrawSurface;
- const procname: String; const args: String): Boolean;
+ const procIndex: Integer; const args: String): Boolean;
var
- i: Integer;
Proc: TCopyProc;
sd1: TDDSurfaceDesc;
sd2: TDDSurfaceDesc;
P: PChar;
begin
Result := False;
- if (Names.Count=0) or
- (d1.Width=0) or (d1.Height=0) or
- (d2.Width=0) or (d2.Height=0) then Exit;
- i := Names.IndexOf(procname);
- if (i=-1) or (i>=CopyProcs.Count) then Exit;
- @Proc := CopyProcs[i];
+ if (procIndex=-1) or (procIndex>=CopyProcs.Count) then Exit;
+ @Proc := CopyProcs[procIndex];
if @Proc=nil then Exit;
P:=@argsBuf;
P[0]:=#0;
diff --git a/Source/pshostunit.pas b/Source/pshostunit.pas
index 42868c3..720e24c 100644
--- a/Source/pshostunit.pas
+++ b/Source/pshostunit.pas
@@ -22,12 +22,9 @@ uses
Windows, Graphics, DIB,
mainunit;
-var
- FilterPath: String;
-
function FullFilterPath(const S: String): String;
begin
- Result := FilterPath+'\'+S;
+ Result := main.FSFolder+'\Filters\'+S;
if Uppercase(ExtractFileExt(S))<>'.8BF' then
Result := Result+'.8BF';
end;
@@ -139,7 +136,5 @@ begin
Active := False;
end;
-begin
- FilterPath := ExtractFilePath(Application.ExeName)+'\Filters'
end.