screensaver

This commit is contained in:
ronaldhordijk
2005-07-23 09:19:11 +00:00
parent ac49ddb123
commit e03da98d5d
10 changed files with 1602 additions and 0 deletions

View File

@ -0,0 +1,41 @@
-$A8
-$B-
-$C-
-$D-
-$E-
-$F-
-$G+
-$H+
-$I+
-$J-
-$K-
-$L-
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$Y-
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-E"../../out"
-N"../../out/dcu"
-LE"x:\programs\borland\delphi6\Projects\Bpl"
-LN"x:\programs\borland\delphi6\Projects\Bpl"
-U"../../source"
-O"../../source"
-I"../../source"
-R"../../source"

View File

@ -0,0 +1,108 @@
[FileVersion]
Version=6.0
[Compiler]
A=8
B=0
C=0
D=0
E=0
F=0
G=1
H=1
I=1
J=0
K=0
L=0
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=0
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=../../out
UnitOutputDir=../../out/dcu
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=../../source
Packages=vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;vcldbx;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k;FlatStyle_D6;rae;S303_R60;S303BR60;dxmdsd6;dxForumLibD6;RzLPDB60;RzLPND60;B301vr60;B301cr60;o401_r60;o401br60;vclshlctrls;LTEffects;B301_r60;gllib
Conditionals=
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=X:\Code\Delphi\Apophysis\2.02h\ScreenSaver\
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[Excluded Packages]
W:\Lib\O403_d60.bpl=TurboPower Orpheus 4.03 Components - VCL60
W:\Lib\S303_d60.bpl=SysTools 3 Components
W:\Lib\dgmr_60.bpl=Dgmr bibliotheek 6.1
c:\proj32\gl\out\gllib.bpl=GL bibliotheek
x:\programs\borland\delphi6\Projects\Bpl\dclusr60.bpl=Borland User Components
C:\Program Files\Indy 10 for Delphi 6\LibD6\dclIndyCore60.bpl=Indy 10 Core Design Time
C:\Program Files\Indy 10 for Delphi 6\LibD6\dclIndyProtocols60.bpl=Indy 10 Protocols Design Time
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
Count=2
Item0=../../source
Item1=../../src
[HistoryLists\hlUnitOutputDirectory]
Count=1
Item0=../../out/dcu
[HistoryLists\hlOutputDirectorry]
Count=1
Item0=../../out

View File

@ -0,0 +1,214 @@
program FlameSS;
uses
Forms,
Dialogs,
SysUtils,
Render,
controlpoint,
windows,
graphics,
messages,
ScrConfig in '..\..\ScreenSaver\ScrConfig.pas' {frmConfig},
ScrMain in '..\..\ScreenSaver\ScrMain.pas' {frmMain},
FlameIO in '..\..\ScreenSaver\FlameIO.pas';
{$E SCR}
{$R *.res}
type TSSMode = (ssSetPwd,ssPreview,ssConfig,ssRun);
var
MySem: THandle;
function GetScreenSaverMode: TSSMode;
var
ParamChar: Char;
begin
Result := ssRun;
if ParamCount = 0 then
Exit;
if Length(ParamStr(1)) = 1 then
ParamChar := ParamStr(1)[1]
else
ParamChar := ParamStr(1)[2];
Case ParamChar of
'A', 'a':
Result := ssSetPwd;
'P', 'p':
Result := ssPreview;
'C', 'c':
Result := ssConfig;
else
Result := ssRun;
end;
end;
procedure SetPassWord;
var
SysDir: string;
NewLen: integer;
MyMod: THandle;
PwdFunc: function (a : PChar; ParentHandle : THandle; b, c : Integer) :
Integer; stdcall;
begin
SetLength(SysDir,MAX_PATH);
NewLen := GetSystemDirectory(PChar(SysDir),MAX_PATH);
SetLength(SysDir,NewLen);
MyMod := LoadLibrary(PChar(IncludeTrailingPathDelimiter(SysDir) + 'MPR.DLL'));
if MyMod <> 0 then begin
PwdFunc := GetProcAddress(MyMod,'PwdChangePasswordA');
if Assigned(PwdFunc) then
PwdFunc('SCRSAVE',StrToInt(paramstr(2)),0,0);
FreeLibrary(MyMod);
end;
end;
function WindowProc(Wnd: HWnd; Msg: Integer; wParam: Word; lParam: Integer): Integer; far; stdcall;
begin
{ Window procedure for the saver preview. Only used for terminating the preview
version of the saver. }
if (Msg = WM_DESTROY) or (Msg = WM_CLOSE) then PostMessage(Wnd, WM_QUIT, 0, 0);
Result := DefWindowProc(Wnd, Msg, wParam, lParam);
end;
procedure Preview;
var
PreviewCanvas: TCanvas;
PreviewRect: TRect;
WndClass: TWndClass;
DC: hDC;
MyWnd: hWnd;
Msg: TMsg;
ParentHandle: THandle;
cp : TControlPoint;
Render: TRenderer;
bm: TBitmap;
begin
{ To run the preview, you need to create a window class corresponding with the
little display in the screensaver control panel. This doesn't look very
elegant in a Delphi project, but I don't think you can use VCL functionality
to do this... }
with WndClass do
begin
style := CS_PARENTDC;
lpfnWndProc := @WindowProc;
cbClsExtra := 0;
cbWndExtra := 0;
hIcon := 0;
hCursor := 0;
hbrBackground := 0;
lpszMenuName := nil;
lpszClassName := 'DeskSpin';
end;
WndClass.hInstance := hInstance;
Windows.RegisterClass(WndClass);
ParentHandle := StrToInt(ParamStr(2));
// Initialize a Rect that matches the preview area:
GetWindowRect(Parenthandle, PreviewRect);
PreviewRect.Right := PreviewRect.Right - PreviewRect.Left;
PreviewRect.Bottom := PreviewRect.Bottom - PreviewRect.Top;
PreviewRect.Left := 0;
PreviewRect.Top := 0;
// Instantiate the window class so we can draw to the preview area:
MyWnd := CreateWindow('DeskSpin', 'DeskSpin',
WS_CHILD or WS_DISABLED or WS_VISIBLE, 0, 0,
PreviewRect.Right, PreviewRect.Bottom, ParentHandle,
0, hInstance, nil);
// We need a DC before we can draw:
DC := GetDC(MyWnd);
{ We can create a TCanvas matching the DC, so we can draw the preview with
familiar functions: }
PreviewCanvas := TCanvas.Create;
PreviewCanvas.Handle := DC;
randomize;
cp := TControlPoint.Create;
Render := TRenderer.Create;
cp.ParseString('pixels_per_unit 277.456647 center -1.0982659 0 gamma 2 spatial_filter_radius' +
' 0.5 contrast 1 brightness 1.5 zoom 0 spatial_oversample 1 sample_density 1 nbatches' +
' 1 white_level 200 cmap_inter 0 time 0 cmap 33 xform 0 density 1 color 0 var 0 0 0 1 0' +
' 0 0 coefs 0.466381997 -0.0618700013 0.0792416036 0.610638022 -0.475656986 -0.28115499'+
' xform 1 density 1 color 1 var 0 0 0 0 1 0 0 coefs -0.513867021 0.271649003 -0.254521996' +
' -0.550984025 -0.674094975 -0.600323975');
cp.sample_density := 1;
cp.Width := PreviewRect.Right - PreviewRect.Left;
cp.Height := PreviewRect.Bottom - PreviewRect.Top;
cp.spatial_oversample := 2;
cp.spatial_filter_radius := 0.1;
cp.Gamma := 4;
cp.brightness := 4;
cp.CalcBoundbox;
Render.SetCP(cp);
Render.Render;
BM := Render.GetImage;
PreviewCanvas.Draw(0,0,bm);
{ Enter a message loop to keep the preview going. I've kept the preview simple
(plain text output), but if you wanted, you could initialize OpenGL for the
DC you already have, and actually let your saver render to that. }
while GetMessage(Msg, 0, 0, 0) do
begin
PreviewCanvas.Draw(0,0,bm);
// PreviewCanvas.FillRect(PreviewRect);
// PreviewCanvas.TextOut(5, 5, 'Your preview here.');
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
PreviewCanvas.Free;
// Close and destroy the preview window:
CloseWindow(MyWnd);
DestroyWindow(MyWnd);
Render.Free;
cp.Free;
end;
begin
Case GetScreenSaverMode of
ssSetPwd:
begin
Application.Initialize;
SetPassWord;
end;
ssConfig:
begin
Application.Initialize;
Application.Title := 'Flame Screensaver';
Application.CreateForm(TfrmConfig, frmConfig);
Application.Run;
end;
ssPreview:
Preview;
else // ssrun
// Test if screen save was already started
MySem := CreateSemaphore(nil,0,1,'ESDSaverSemaphore');
if (MySem <> 0) and (GetLastError = ERROR_ALREADY_EXISTS) then begin
CloseHandle(MySem);
Exit;
end;
Application.Initialize;
Application.CreateForm(TfrmMain, frmMain);
Application.Run;
if (MySem <> 0) then
CloseHandle(MySem);
end; // Case GetScreenSaverMode of
end.

View File

@ -0,0 +1,280 @@
[Closed Files]
File_0=SourceModule,'C:\PROJ32\gl\src\catalog.pas',0,1,561,1,585,0,0
File_1=SourceModule,'C:\PROJ32\gl\src\CatFilter.pas',0,1,57,24,71,0,0
File_2=SourceModule,'C:\PROJ32\gl\src\FCatFilter.pas',0,1,1,1,12,0,0
File_3=SourceModule,'C:\PROJ32\gl\src\glStrConst.pas',0,1,1,39,1,0,0
File_4=SourceModule,'C:\PROJ32\gl\src\Project.pas',0,1,498,1,520,0,0
File_5=SourceModule,'C:\PROJ32\gl\src\MainForm.pas',0,1,212,27,215,0,0
File_6=SourceModule,'C:\PROJ32\gl\src\Material.pas',0,1,912,111,947,0,0
File_7=SourceModule,'C:\PROJ32\gl\src\FArea.pas',0,1,202,111,219,0,0
File_8=SourceModule,'C:\PROJ32\gl\src\FCatalog.pas',0,1,582,6,610,0,0
File_9=SourceModule,'C:\PROJ32\gl\src\kierterm.pas',0,1,622,1,647,0,0
[Modules]
Module0=X:\Code\Delphi\Apophysis\2.02h\Project\delphi6\FlameSS.dpr
Count=1
EditWindowCount=1
[X:\Code\Delphi\Apophysis\2.02h\Project\delphi6\FlameSS.dpr]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[X:\Programs\Borland\Delphi6\Projects\ProjectGroup1.bpg]
FormState=0
FormOnTop=0
[EditWindow0]
ViewCount=1
CurrentView=0
View0=0
CodeExplorer=CodeExplorer@EditWindow0
MessageView=MessageView@EditWindow0
Create=1
Visible=1
State=0
Left=266
Top=111
Width=1016
Height=880
MaxLeft=-4
MaxTop=108
ClientWidth=1008
ClientHeight=846
LeftPanelSize=0
RightPanelSize=0
BottomPanelSize=52
BottomPanelClients=MessageView@EditWindow0
BottomPanelData=000004000000000000000000000000000000000000000000000100000000000000000B0000004D65737361676556696577FFFFFFFF
[View0]
Module=X:\Code\Delphi\Apophysis\2.02h\Project\delphi6\FlameSS.dpr
CursorX=46
CursorY=16
TopLine=1
LeftCol=1
[Watches]
Count=0
[Breakpoints]
Count=0
[AddressBreakpoints]
Count=0
[Main Window]
Create=1
Visible=1
State=0
Left=0
Top=0
Width=1280
Height=112
MaxLeft=-1
MaxTop=-1
ClientWidth=1272
ClientHeight=78
[ProjectManager]
Create=1
Visible=1
State=0
Left=0
Top=0
Width=231
Height=843
MaxLeft=-1
MaxTop=-1
ClientWidth=231
ClientHeight=843
TBDockHeight=305
LRDockWidth=438
Dockable=1
[CPUWindow]
Create=1
Visible=0
State=0
Left=373
Top=335
Width=533
Height=353
MaxLeft=-1
MaxTop=-1
ClientWidth=525
ClientHeight=319
DumpPane=79
DisassemblyPane=187
RegisterPane=231
FlagPane=64
[AlignmentPalette]
Create=1
Visible=0
State=0
Left=200
Top=114
Width=156
Height=84
MaxLeft=-1
MaxTop=-1
ClientWidth=150
ClientHeight=60
[PropertyInspector]
Create=1
Visible=1
State=0
Left=0
Top=0
Width=231
Height=843
MaxLeft=-1
MaxTop=-1
ClientWidth=231
ClientHeight=843
TBDockHeight=527
LRDockWidth=190
Dockable=1
SplitPos=85
ArrangeBy=Name
SelectedItem=
ExpandedItems=
HiddenCategories=
[WatchWindow]
Create=1
Visible=0
State=0
Left=232
Top=872
Width=1048
Height=165
MaxLeft=-1
MaxTop=-1
ClientWidth=1040
ClientHeight=139
TBDockHeight=149
LRDockWidth=421
Dockable=1
[CallStackWindow]
Create=1
Visible=1
State=0
Left=0
Top=0
Width=231
Height=843
MaxLeft=-1
MaxTop=-1
ClientWidth=231
ClientHeight=843
TBDockHeight=161
LRDockWidth=294
Dockable=1
[ObjectTree]
Create=1
Visible=0
State=0
Left=0
Top=112
Width=190
Height=350
MaxLeft=-1
MaxTop=-1
ClientWidth=182
ClientHeight=324
TBDockHeight=350
LRDockWidth=190
Dockable=1
[DebugLogView]
Create=1
Visible=0
State=0
Left=232
Top=872
Width=1048
Height=165
MaxLeft=-1
MaxTop=-1
ClientWidth=1040
ClientHeight=139
TBDockHeight=291
LRDockWidth=417
Dockable=1
[LocalVarsWindow]
Create=1
Visible=0
State=0
Left=27
Top=127
Width=194
Height=891
MaxLeft=-1
MaxTop=-1
ClientWidth=186
ClientHeight=865
TBDockHeight=110
LRDockWidth=421
Dockable=1
[CodeExplorer@EditWindow0]
Create=1
Visible=1
State=0
Left=0
Top=0
Width=231
Height=843
MaxLeft=-1
MaxTop=-1
ClientWidth=231
ClientHeight=843
TBDockHeight=305
LRDockWidth=140
Dockable=1
[MessageView@EditWindow0]
Create=1
Visible=1
State=0
Left=12
Top=0
Width=996
Height=52
MaxLeft=-1
MaxTop=-1
ClientWidth=996
ClientHeight=52
TBDockHeight=52
LRDockWidth=443
Dockable=1
[DockHosts]
DockHostCount=1
[DockSite0]
DockSiteType=1
Create=1
Visible=1
State=0
Left=0
Top=112
Width=266
Height=877
MaxLeft=-1
MaxTop=-1
ClientWidth=258
ClientHeight=851
TBDockHeight=451
LRDockWidth=177
Dockable=1
TabPosition=2
ActiveTab=Project Manager
TabDockClients=ProjectManager,CodeExplorer@EditWindow0,CallStackWindow,PropertyInspector

Binary file not shown.