1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Preliminary Delphi7 support, CommandLine with values, Custom libcef.dll path

This commit is contained in:
Salvador Diaz Fau
2017-02-14 11:01:16 +01:00
parent bde555ddfa
commit 8d3316ba80
23 changed files with 639 additions and 181 deletions

View File

@ -57,8 +57,14 @@ begin
GlobalCEFApp.RemoteDebuggingPort := 9000; GlobalCEFApp.RemoteDebuggingPort := 9000;
GlobalCEFApp.RenderProcessHandler := TCustomRenderProcessHandler.Create; GlobalCEFApp.RenderProcessHandler := TCustomRenderProcessHandler.Create;
// Example of command line switch. Uncomment the following line to see an FPS counter in the browser. // Examples of command line switches.
// **********************************
//
// Uncomment the following line to see an FPS counter in the browser.
//GlobalCEFApp.AddCustomCommandLine('--show-fps-counter'); //GlobalCEFApp.AddCustomCommandLine('--show-fps-counter');
//
// Uncomment the following line to change the user agent string.
//GlobalCEFApp.AddCustomCommandLine('--user-agent', 'MiniBrowser');
if GlobalCEFApp.StartMainProcess then if GlobalCEFApp.StartMainProcess then
begin begin

View File

@ -1,27 +1,34 @@
[Closed Files] [Closed Files]
File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas',0,1,741,71,779,0,0,,{1,727,73} File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFWebPluginUnstableCallback.pas',0,1,1,1,1,0,0,,
File_1=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas',0,1,957,68,985,0,0,, File_1=TSourceModule,'V:\source_D7\uCEFWebPluginUnstableCallback.pas',0,1,1,1,1,0,0,,
File_2=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFChromium.pas',0,1,1998,7,2013,0,0,, File_2=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFv8Types.pas',0,1,16,1,1,0,0,,
File_3=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFClient.pas',0,1,490,71,507,0,0,, File_3=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFv8Handler.pas',0,1,34,57,81,0,0,,
File_4=TSourceModule,'c:\program files\embarcadero\studio\17.0\SOURCE\RTL\SYS\System.SysUtils.pas',0,1,25193,1,25222,0,0,, File_4=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uTestExtension.pas',0,1,63,3,86,0,0,,
File_5=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFMiscFunctions.pas',0,1,421,23,440,0,0,, File_5=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFWebPluginInfoVisitor.pas',0,1,1,1,1,0,0,,
File_6=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFX509CertPrincipal.pas',0,1,179,21,194,0,0,, File_6=TSourceModule,'V:\source_D7\uCEFWebPluginInfoVisitor.pas',0,1,1,1,1,0,0,,
File_7=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRequestHandler.pas',0,1,284,48,300,0,0,, File_7=TSourceModule,'V:\source_D7\uCEFv8Types.pas',0,1,1,1,1,0,0,,
File_8=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFLibFunctions.pas',0,1,196,10,229,0,0,, File_8=TSourceModule,'V:\source_D7\uCEFv8Handler.pas',0,1,1,1,1,0,0,,
File_9=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFInterfaces.pas',0,1,69,3,103,0,0,, File_9=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas',0,1,1,1,1,0,0,,
[Modules] [Modules]
Module0=default.htm Module0=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas
Count=1 Module1=default.htm
Count=2
EditWindowCount=1 EditWindowCount=1
[C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0
[default.htm] [default.htm]
ModuleType=TURLModule ModuleType=TURLModule
[EditWindow0] [EditWindow0]
ViewCount=1 ViewCount=2
CurrentView=0 CurrentEditView=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas
View0=0 View0=0
View1=1
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=1 Visible=1
@ -38,23 +45,34 @@ ClientHeight=9428
DockedToMainForm=1 DockedToMainForm=1
BorlandEditorCodeExplorer=BorlandEditorCodeExplorer@EditWindow0 BorlandEditorCodeExplorer=BorlandEditorCodeExplorer@EditWindow0
TopPanelSize=0 TopPanelSize=0
LeftPanelSize=1898 LeftPanelSize=0
LeftPanelClients=PropertyInspector,DockSite3
LeftPanelData=00000800010100000000AA19000000000000016A0700000000000001000000005D0E000009000000446F636B53697465330100000000A12300001100000050726F7065727479496E73706563746F72FFFFFFFF
RightPanelSize=2000 RightPanelSize=2000
RightPanelClients=DockSite2,DockSite4 RightPanelClients=DockSite2
RightPanelData=00000800010100000000AA1900000000000001D00700000000000001000000004312000009000000446F636B53697465320100000000A123000009000000446F636B5369746534FFFFFFFF RightPanelData=000008000101000000001E1500000000000001D0070000000000000100000000511D000009000000446F636B5369746532FFFFFFFF
BottomPanelSize=0 BottomPanelSize=1551
BottomPanelClients=DockSite1,MessageView BottomPanelClients=DockSite1,MessageView
BottomPanelData=0000080001020200000009000000446F636B53697465310F0000004D65737361676556696577466F726D1234000000000000022506000000000000FFFFFFFF BottomPanelData=0000080001020100000009000000446F636B53697465313B36000000000000020F0600000000000001000000003B3600000F0000004D65737361676556696577466F726DFFFFFFFF
BottomMiddlePanelSize=0 BottomMiddlePanelSize=0
BottomMiddlePanelClients=DockSite0,GraphDrawingModel BottomMiddlePanelClients=DockSite0,GraphDrawingModel
BottomMiddelPanelData=0000080001020200000009000000446F636B536974653010000000477261706844726177696E67566965779D1D00000000000002F306000000000000FFFFFFFF BottomMiddelPanelData=0000080001020200000009000000446F636B536974653010000000477261706844726177696E67566965779D1D00000000000002F306000000000000FFFFFFFF
TabDockLeftClients=PropertyInspector=0,DockSite3=1
TabDockRightClients=DockSite4=0
[View0] [View0]
CustomEditViewType=TWelcomePageView CustomEditViewType=TWelcomePageView
WelcomePageURL=bds:/default.htm WelcomePageURL=bds:/default.htm
[View1]
CustomEditViewType=TEditView
Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas
CursorX=40
CursorY=873
TopLine=839
LeftCol=1
Elisions=
Bookmarks=
EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas
[Watches] [Watches]
Count=0 Count=0
@ -117,11 +135,11 @@ State=0
Left=0 Left=0
Top=0 Top=0
Width=2000 Width=2000
Height=4226 Height=7197
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=4226 ClientHeight=7197
TBDockHeight=5897 TBDockHeight=5897
LRDockWidth=2352 LRDockWidth=2352
Dockable=1 Dockable=1
@ -130,18 +148,18 @@ StayOnTop=0
[MessageView] [MessageView]
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=0 Visible=1
Docked=1 Docked=1
State=0 State=0
Left=0 Left=0
Top=0 Top=23
Width=2773 Width=10000
Height=1424 Height=1345
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2773 ClientWidth=10000
ClientHeight=1424 ClientHeight=1345
TBDockHeight=1424 TBDockHeight=1345
LRDockWidth=2773 LRDockWidth=2773
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0
@ -209,8 +227,8 @@ Create=1
Visible=0 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=-148 Left=-121
Top=-137 Top=-74
Width=1844 Width=1844
Height=3139 Height=3139
MaxLeft=-1 MaxLeft=-1
@ -263,7 +281,7 @@ StayOnTop=0
[PropertyInspector] [PropertyInspector]
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=1 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=0 Left=0
@ -274,7 +292,7 @@ MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1898 ClientWidth=1898
ClientHeight=5370 ClientHeight=5370
TBDockHeight=7164 TBDockHeight=7119
LRDockWidth=1898 LRDockWidth=1898
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0
@ -289,11 +307,11 @@ State=0
Left=0 Left=0
Top=0 Top=0
Width=2000 Width=2000
Height=6861 Height=6816
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=6861 ClientHeight=6816
TBDockHeight=5964 TBDockHeight=5964
LRDockWidth=2508 LRDockWidth=2508
Dockable=1 Dockable=1
@ -305,8 +323,8 @@ Create=1
Visible=0 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=-898 Left=-946
Top=-137 Top=1
Width=2844 Width=2844
Height=6200 Height=6200
MaxLeft=-1 MaxLeft=-1
@ -324,8 +342,8 @@ Create=1
Visible=0 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=-1026 Left=-1152
Top=-137 Top=243
Width=273 Width=273
Height=359 Height=359
MaxLeft=-1 MaxLeft=-1
@ -429,11 +447,11 @@ State=0
Left=0 Left=0
Top=0 Top=0
Width=2336 Width=2336
Height=1177 Height=942
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2336 ClientWidth=2336
ClientHeight=1177 ClientHeight=942
TBDockHeight=2321 TBDockHeight=2321
LRDockWidth=2820 LRDockWidth=2820
Dockable=1 Dockable=1
@ -494,11 +512,11 @@ State=0
Left=0 Left=0
Top=0 Top=0
Width=2000 Width=2000
Height=6861 Height=6816
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=6861 ClientHeight=6816
TBDockHeight=4888 TBDockHeight=4888
LRDockWidth=7148 LRDockWidth=7148
Dockable=1 Dockable=1
@ -510,8 +528,8 @@ Create=1
Visible=0 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=0 Left=249
Top=0 Top=709
Width=2859 Width=2859
Height=3206 Height=3206
MaxLeft=-1 MaxLeft=-1
@ -558,11 +576,11 @@ State=0
Left=0 Left=0
Top=0 Top=0
Width=1898 Width=1898
Height=3498 Height=9170
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1898 ClientWidth=1898
ClientHeight=3498 ClientHeight=9170
TBDockHeight=3677 TBDockHeight=3677
LRDockWidth=1898 LRDockWidth=1898
Dockable=1 Dockable=1
@ -577,11 +595,11 @@ State=0
Left=0 Left=0
Top=0 Top=0
Width=2000 Width=2000
Height=6861 Height=6816
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=6861 ClientHeight=6816
TBDockHeight=4888 TBDockHeight=4888
LRDockWidth=5305 LRDockWidth=5305
Dockable=1 Dockable=1
@ -642,7 +660,7 @@ Visible=0
Docked=1 Docked=1
State=0 State=0
Left=0 Left=0
Top=0 Top=23
Width=3820 Width=3820
Height=1424 Height=1424
MaxLeft=-1 MaxLeft=-1
@ -668,12 +686,12 @@ State=0
Left=0 Left=0
Top=23 Top=23
Width=2000 Width=2000
Height=4529 Height=7500
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=4529 ClientHeight=7500
TBDockHeight=7164 TBDockHeight=7119
LRDockWidth=2000 LRDockWidth=2000
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0
@ -682,22 +700,22 @@ ActiveTabID=ProjectManager
TabDockClients=ProjectManager,ModelViewTool,DataExplorerContainer,frmDesignPreview,TFileExplorerForm TabDockClients=ProjectManager,ModelViewTool,DataExplorerContainer,frmDesignPreview,TFileExplorerForm
[DockSite3] [DockSite3]
HostDockSite=DockLeftPanel HostDockSite=LeftDockTabSet
DockSiteType=1 DockSiteType=1
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=1 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=0 Left=0
Top=23 Top=23
Width=1898 Width=1898
Height=3498 Height=9170
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1898 ClientWidth=1898
ClientHeight=3498 ClientHeight=9170
TBDockHeight=7164 TBDockHeight=7119
LRDockWidth=1898 LRDockWidth=1898
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0
@ -706,11 +724,11 @@ ActiveTabID=StructureView
TabDockClients=StructureView,ClassBrowserTool TabDockClients=StructureView,ClassBrowserTool
[DockSite4] [DockSite4]
HostDockSite=DockRightPanel HostDockSite=RightTabDock
DockSiteType=1 DockSiteType=1
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=1 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=0 Left=0
@ -721,7 +739,7 @@ MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=4339 ClientHeight=4339
TBDockHeight=7164 TBDockHeight=7119
LRDockWidth=2000 LRDockWidth=2000
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0

Binary file not shown.

View File

@ -1,9 +1,9 @@
[Stats] [Stats]
EditorSecs=32530 EditorSecs=34706
DesignerSecs=14 DesignerSecs=14
InspectorSecs=9 InspectorSecs=9
CompileSecs=559079 CompileSecs=616498
OtherSecs=2807 OtherSecs=3165
StartTime=22/01/2017 10:49:52 StartTime=22/01/2017 10:49:52
RealKeys=0 RealKeys=0
EffectiveKeys=0 EffectiveKeys=0

45
source/CEF4Delphi_D7.cfg Normal file
View File

@ -0,0 +1,45 @@
-$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
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-N"dcu\"
-LE"c:\delphi\delphi7\Projects\Bpl"
-LN"c:\delphi\delphi7\Projects\Bpl"
-U";C:\Delphi\Installed Components\TeeChart Standard 2014 for Delphi 7\Delphi7\Lib"
-O";C:\Delphi\Installed Components\TeeChart Standard 2014 for Delphi 7\Delphi7\Lib"
-I";C:\Delphi\Installed Components\TeeChart Standard 2014 for Delphi 7\Delphi7\Lib"
-R";C:\Delphi\Installed Components\TeeChart Standard 2014 for Delphi 7\Delphi7\Lib"
-DDEBUG
-Z
-w-UNSAFE_TYPE
-w-UNSAFE_CODE
-w-UNSAFE_CAST

154
source/CEF4Delphi_D7.dof Normal file
View File

@ -0,0 +1,154 @@
[FileVersion]
Version=7.0
[Compiler]
A=8
B=0
C=1
D=0
E=0
F=0
G=1
H=1
I=1
J=0
K=0
L=1
M=0
N=1
O=0
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=1
X=1
Y=1
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
NamespacePrefix=
SymbolDeprecated=1
SymbolLibrary=1
SymbolPlatform=1
UnitLibrary=1
UnitPlatform=1
UnitDeprecated=1
HResultCompat=1
HidingMember=1
HiddenVirtual=1
Garbage=1
BoundsError=1
ZeroNilCompat=1
StringConstTruncated=1
ForLoopVarVarPar=1
TypedConstVarPar=1
AsgToTypedConst=1
CaseLabelRange=1
ForVariable=1
ConstructingAbstract=1
ComparisonFalse=1
ComparisonTrue=1
ComparingSignedUnsigned=1
CombiningSignedUnsigned=1
UnsupportedConstruct=1
FileOpen=1
FileOpenUnitSrc=1
BadGlobalSymbol=1
DuplicateConstructorDestructor=1
InvalidDirective=1
PackageNoLink=1
PackageThreadVar=1
ImplicitImport=1
HPPEMITIgnored=1
NoRetVal=1
UseBeforeDef=1
ForLoopVarUndef=1
UnitNameMismatch=1
NoCFGFileFound=1
MessageDirective=1
ImplicitVariants=1
UnicodeToLocale=1
LocaleToUnicode=1
ImagebaseMultiple=1
SuspiciousTypecast=1
PrivatePropAccessor=1
UnsafeType=0
UnsafeCode=0
UnsafeCast=0
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=CEF4Delphi
[Directories]
OutputDir=
UnitOutputDir=dcu\
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=;C:\Delphi\Installed Components\TeeChart Standard 2014 for Delphi 7\Delphi7\Lib
Packages=rtl;vcl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;dclOfficeXP;tb2k_d7;tbx_d7;TntUnicodeVcl_R70;SpTBXLib_d7;RaizeComponentsVcl;RaizeComponentsVclDb;madBasic_;madDisAsm_;madExcept_;Tee97;TeeUI97;TeeDB97
Conditionals=DEBUG
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=C:\Delphi\Delphi7\Bin\
[Version Info]
IncludeVerInfo=1
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=7177
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]
C:\Delphi\Delphi7\Projects\Bpl\cxDataD7.bpl=ExpressDataController by Developer Express Inc.
c:\delphi\delphi7\Projects\Bpl\nexusprovider70.bpl=UniDAC NexusDB Provider
C:\Delphi\Components\dotNet\Managed VCL\bpl\ManagedDCL70.bpl=Managed extensions for VCL
C:\Delphi\Installed Components\FastReport 4\LibD7\dclfstee7.bpl=FastScript 1.9 Tee Components
C:\Delphi\Installed Components\FastReport 4\LibD7\dclfrxtee7.bpl=FastReport 4.0 Tee Components
[HistoryLists\hlConditionals]
Count=1
Item0=DEBUG
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
Count=1
Item0=;C:\Delphi\Installed Components\TeeChart Standard 2014 for Delphi 7\Delphi7\Lib
[HistoryLists\hlUnitOutputDirectory]
Count=1
Item0=dcu\

152
source/CEF4Delphi_D7.dpk Normal file
View File

@ -0,0 +1,152 @@
package CEF4Delphi_D7;
{$R *.res}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO OFF}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS ON}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION OFF}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO ON}
{$SAFEDIVIDE OFF}
{$STACKFRAMES ON}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DESCRIPTION 'CEF4Delphi'}
{$IMPLICITBUILD OFF}
{$DEFINE DEBUG}
requires
rtl,
vcl;
contains
uCEFRegisterComponents in 'uCEFRegisterComponents.pas',
uCEFFindHandler in 'uCEFFindHandler.pas',
uCEFConstants in 'uCEFConstants.pas',
uCEFTypes in 'uCEFTypes.pas',
uCEFInterfaces in 'uCEFInterfaces.pas',
uCEFMiscFunctions in 'uCEFMiscFunctions.pas',
uCEFLibFunctions in 'uCEFLibFunctions.pas',
uCEFApplication in 'uCEFApplication.pas',
uCEFBase in 'uCEFBase.pas',
uCEFSchemeRegistrar in 'uCEFSchemeRegistrar.pas',
uCEFCommandLine in 'uCEFCommandLine.pas',
uCEFClient in 'uCEFClient.pas',
uCEFProcessMessage in 'uCEFProcessMessage.pas',
uCEFBrowser in 'uCEFBrowser.pas',
uCEFListValue in 'uCEFListValue.pas',
uCEFBinaryValue in 'uCEFBinaryValue.pas',
uCEFValue in 'uCEFValue.pas',
uCEFDictionaryValue in 'uCEFDictionaryValue.pas',
uCEFDownloadImageCallBack in 'uCEFDownloadImageCallBack.pas',
uCEFFrame in 'uCEFFrame.pas',
uCEFPDFPrintCallback in 'uCEFPDFPrintCallback.pas',
uCEFRunFileDialogCallback in 'uCEFRunFileDialogCallback.pas',
uCEFRequestContext in 'uCEFRequestContext.pas',
uCEFNavigationEntryVisitor in 'uCEFNavigationEntryVisitor.pas',
uCEFStringVisitor in 'uCEFStringVisitor.pas',
uCEFv8Context in 'uCEFv8Context.pas',
uCEFDomVisitor in 'uCEFDomVisitor.pas',
uCEFNavigationEntry in 'uCEFNavigationEntry.pas',
uCEFCookieManager in 'uCEFCookieManager.pas',
uCEFCompletionCallback in 'uCEFCompletionCallback.pas',
uCEFRequestContextHandler in 'uCEFRequestContextHandler.pas',
uCEFWebPluginInfo in 'uCEFWebPluginInfo.pas',
uCEFDomDocument in 'uCEFDomDocument.pas',
uCEFDomNode in 'uCEFDomNode.pas',
uCEFv8Value in 'uCEFv8Value.pas',
uCEFv8Accessor in 'uCEFv8Accessor.pas',
uCEFLoadHandler in 'uCEFLoadHandler.pas',
uCEFFocusHandler in 'uCEFFocusHandler.pas',
uCEFContextMenuHandler in 'uCEFContextMenuHandler.pas',
uCEFDialogHandler in 'uCEFDialogHandler.pas',
uCEFKeyboardHandler in 'uCEFKeyboardHandler.pas',
uCEFDisplayHandler in 'uCEFDisplayHandler.pas',
uCEFDownloadHandler in 'uCEFDownloadHandler.pas',
uCEFGeolocationHandler in 'uCEFGeolocationHandler.pas',
uCEFJsDialogHandler in 'uCEFJsDialogHandler.pas',
uCEFLifeSpanHandler in 'uCEFLifeSpanHandler.pas',
uCEFRequestHandler in 'uCEFRequestHandler.pas',
uCEFRenderHandler in 'uCEFRenderHandler.pas',
uCEFDragHandler in 'uCEFDragHandler.pas',
uCEFPostData in 'uCEFPostData.pas',
uCEFPostDataElement in 'uCEFPostDataElement.pas',
uCEFRequest in 'uCEFRequest.pas',
uCEFStreamReader in 'uCEFStreamReader.pas',
uCEFWriteHandler in 'uCEFWriteHandler.pas',
uCEFStreamWriter in 'uCEFStreamWriter.pas',
uCEFv8StackFrame in 'uCEFv8StackFrame.pas',
uCEFv8StackTrace in 'uCEFv8StackTrace.pas',
uCEFv8Handler in 'uCEFv8Handler.pas',
uCEFRequestCallback in 'uCEFRequestCallback.pas',
uCEFCustomStreamReader in 'uCEFCustomStreamReader.pas',
uCEFCallback in 'uCEFCallback.pas',
uCEFResourceHandler in 'uCEFResourceHandler.pas',
uCEFSchemeHandlerFactory in 'uCEFSchemeHandlerFactory.pas',
uCEFTask in 'uCEFTask.pas',
uCEFTaskRunner in 'uCEFTaskRunner.pas',
uCEFStringMap in 'uCEFStringMap.pas',
uCEFStringMultimap in 'uCEFStringMultimap.pas',
uCEFXmlReader in 'uCEFXmlReader.pas',
uCEFZipReader in 'uCEFZipReader.pas',
uCEFResponse in 'uCEFResponse.pas',
uCEFCookieVisitor in 'uCEFCookieVisitor.pas',
uCEFV8Exception in 'uCEFV8Exception.pas',
uCEFResourceBundleHandler in 'uCEFResourceBundleHandler.pas',
uCEFSetCookieCallback in 'uCEFSetCookieCallback.pas',
uCEFDeleteCookiesCallback in 'uCEFDeleteCookiesCallback.pas',
uCEFDownLoadItem in 'uCEFDownLoadItem.pas',
uCEFBeforeDownloadCallback in 'uCEFBeforeDownloadCallback.pas',
uCEFDownloadItemCallback in 'uCEFDownloadItemCallback.pas',
uCEFAuthCallback in 'uCEFAuthCallback.pas',
uCEFJsDialogCallback in 'uCEFJsDialogCallback.pas',
uCEFGeolocationCallback in 'uCEFGeolocationCallback.pas',
uCEFContextMenuParams in 'uCEFContextMenuParams.pas',
uCEFMenuModel in 'uCEFMenuModel.pas',
uCEFBrowserProcessHandler in 'uCEFBrowserProcessHandler.pas',
uCEFRenderProcessHandler in 'uCEFRenderProcessHandler.pas',
uCEFUrlrequestClient in 'uCEFUrlrequestClient.pas',
uCEFUrlRequest in 'uCEFUrlRequest.pas',
uCEFWebPluginInfoVisitor in 'uCEFWebPluginInfoVisitor.pas',
uCEFWebPluginUnstableCallback in 'uCEFWebPluginUnstableCallback.pas',
uCEFEndTracingCallback in 'uCEFEndTracingCallback.pas',
uCEFGetGeolocationCallback in 'uCEFGetGeolocationCallback.pas',
uCEFFileDialogCallback in 'uCEFFileDialogCallback.pas',
uCEFDragData in 'uCEFDragData.pas',
uCEFResolveCallback in 'uCEFResolveCallback.pas',
uCEFPrintSettings in 'uCEFPrintSettings.pas',
uCEFSslInfo in 'uCEFSslInfo.pas',
uCEFRunContextMenuCallback in 'uCEFRunContextMenuCallback.pas',
uCEFResourceBundle in 'uCEFResourceBundle.pas',
uCEFResponseFilter in 'uCEFResponseFilter.pas',
uCEFImage in 'uCEFImage.pas',
uCEFMenuModelDelegate in 'uCEFMenuModelDelegate.pas',
uCEFv8Types in 'uCEFv8Types.pas',
uCEFWindowParent in 'uCEFWindowParent.pas',
uCEFChromium in 'uCEFChromium.pas',
uCEFChromiumEvents in 'uCEFChromiumEvents.pas',
uCEFChromiumOptions in 'uCEFChromiumOptions.pas',
uCEFChromiumFontOptions in 'uCEFChromiumFontOptions.pas',
uCEFPDFPrintOptions in 'uCEFPDFPrintOptions.pas',
uCEFRegisterCDMCallback in 'uCEFRegisterCDMCallback.pas',
uCEFThread in 'uCEFThread.pas',
uCEFv8Interceptor in 'uCEFv8Interceptor.pas',
uCEFWaitableEvent in 'uCEFWaitableEvent.pas',
uCEFX509CertPrincipal in 'uCEFX509CertPrincipal.pas',
uCEFX509Certificate in 'uCEFX509Certificate.pas',
uCEFSSLStatus in 'uCEFSSLStatus.pas',
uCEFSelectClientCertificateCallback in 'uCEFSelectClientCertificateCallback.pas',
uCEFChromiumWindow in 'uCEFChromiumWindow.pas';
end.

BIN
source/CEF4Delphi_D7.res Normal file

Binary file not shown.

View File

@ -0,0 +1,10 @@
[ExpressSkins]
Default=1
ShowNotifications=1
Enabled=1
dxSkinBlack=1
dxSkinBlue=1
dxSkinDevExpressStyle=1
dxSkinOffice2010Black=1
dxSkinOffice2013White=1
dxSkinsDefaultPainters=1

View File

@ -102,6 +102,7 @@ type
FApp : TInternalApp; FApp : TInternalApp;
FAppIntf : ICefApp; FAppIntf : ICefApp;
FCustomCommandLines : TStringList; FCustomCommandLines : TStringList;
FCustomCommandLineValues : TStringList;
FFlashEnabled : boolean; FFlashEnabled : boolean;
FCheckCEFFiles : boolean; FCheckCEFFiles : boolean;
FLibLoaded : boolean; FLibLoaded : boolean;
@ -111,6 +112,7 @@ type
FResourceBundleHandler : ICefResourceBundleHandler; FResourceBundleHandler : ICefResourceBundleHandler;
FBrowserProcessHandler : ICefBrowserProcessHandler; FBrowserProcessHandler : ICefBrowserProcessHandler;
FRenderProcessHandler : ICefRenderProcessHandler; FRenderProcessHandler : ICefRenderProcessHandler;
FLibCef : string;
function LoadCEFlibrary : boolean; function LoadCEFlibrary : boolean;
function Load_cef_app_capi_h : boolean; function Load_cef_app_capi_h : boolean;
@ -166,6 +168,7 @@ type
function CheckLocales : boolean; function CheckLocales : boolean;
function CheckResources : boolean; function CheckResources : boolean;
function CheckDLLs : boolean; function CheckDLLs : boolean;
procedure DeleteDirContents(const aDirectory : string);
procedure UInt64ToFileVersionInfo(const aVersion : uint64; var aVersionInfo : TFileVersionInfo); procedure UInt64ToFileVersionInfo(const aVersion : uint64; var aVersionInfo : TFileVersionInfo);
procedure UpdateChromeVersionInfo; procedure UpdateChromeVersionInfo;
@ -181,7 +184,7 @@ type
constructor Create; constructor Create;
destructor Destroy; override; destructor Destroy; override;
procedure AfterConstruction; override; procedure AfterConstruction; override;
procedure AddCustomCommandLine(const aCommandLine : string); procedure AddCustomCommandLine(const aCommandLine : string; const aValue : string = '');
function StartMainProcess : boolean; function StartMainProcess : boolean;
function StartSubProcess : boolean; function StartSubProcess : boolean;
@ -229,6 +232,7 @@ type
property BrowserProcessHandler : ICefBrowserProcessHandler read FBrowserProcessHandler write FBrowserProcessHandler; property BrowserProcessHandler : ICefBrowserProcessHandler read FBrowserProcessHandler write FBrowserProcessHandler;
property RenderProcessHandler : ICefRenderProcessHandler read FRenderProcessHandler write FRenderProcessHandler; property RenderProcessHandler : ICefRenderProcessHandler read FRenderProcessHandler write FRenderProcessHandler;
property LibLoaded : boolean read FLibLoaded; property LibLoaded : boolean read FLibLoaded;
property LibCef : string read FLibCef write FLibCef;
end; end;
TCefAppOwn = class(TCefBaseOwn, ICefApp) TCefAppOwn = class(TCefBaseOwn, ICefApp)
@ -276,7 +280,7 @@ uses
{$IFDEF DELPHI16_UP} {$IFDEF DELPHI16_UP}
System.Math, System.IOUtils, System.SysUtils, System.Math, System.IOUtils, System.SysUtils,
{$ELSE} {$ELSE}
Math, IOUtils, SysUtils, Math, {$IFDEF DELPHI12_UP}IOUtils,{$ENDIF} SysUtils,
{$ENDIF} {$ENDIF}
uCEFLibFunctions, uCEFMiscFunctions, uCEFSchemeRegistrar, uCEFCommandLine, uCEFLibFunctions, uCEFMiscFunctions, uCEFSchemeRegistrar, uCEFCommandLine,
uCEFConstants; uCEFConstants;
@ -330,12 +334,14 @@ begin
FAppIntf := nil; FAppIntf := nil;
FFlashEnabled := True; FFlashEnabled := True;
FCustomCommandLines := nil; FCustomCommandLines := nil;
FCustomCommandLineValues := nil;
FCheckCEFFiles := True; FCheckCEFFiles := True;
FOnRegisterCustomSchemes := nil; FOnRegisterCustomSchemes := nil;
FResourceBundleHandler := nil; FResourceBundleHandler := nil;
FBrowserProcessHandler := nil; FBrowserProcessHandler := nil;
FRenderProcessHandler := nil; FRenderProcessHandler := nil;
FLibLoaded := False; FLibLoaded := False;
FLibCef := 'libcef.dll';
UpdateChromeVersionInfo; UpdateChromeVersionInfo;
@ -352,6 +358,7 @@ begin
FApp := nil; FApp := nil;
if (FCustomCommandLines <> nil) then FreeAndNil(FCustomCommandLines); if (FCustomCommandLines <> nil) then FreeAndNil(FCustomCommandLines);
if (FCustomCommandLineValues <> nil) then FreeAndNil(FCustomCommandLineValues);
inherited Destroy; inherited Destroy;
end; end;
@ -361,11 +368,13 @@ begin
inherited AfterConstruction; inherited AfterConstruction;
FCustomCommandLines := TStringList.Create; FCustomCommandLines := TStringList.Create;
FCustomCommandLineValues := TStringList.Create;
end; end;
procedure TCefApplication.AddCustomCommandLine(const aCommandLine : string); procedure TCefApplication.AddCustomCommandLine(const aCommandLine, aValue : string);
begin begin
if (FCustomCommandLines <> nil) then FCustomCommandLines.Add(aCommandLine); if (FCustomCommandLines <> nil) then FCustomCommandLines.Add(aCommandLine);
if (FCustomCommandLineValues <> nil) then FCustomCommandLineValues.Add(aValue);
end; end;
function TCefApplication.CreateInternalApp : boolean; function TCefApplication.CreateInternalApp : boolean;
@ -492,60 +501,64 @@ begin
else else
TempDir := 'locales'; TempDir := 'locales';
Result := DirectoryExists(TempDir) and if DirectoryExists(TempDir) then
FileExists(TempDir + '\am.pak') and begin
FileExists(TempDir + '\ar.pak') and if (TempDir[length(TempDir)] <> '\') then TempDir := TempDir + '\';
FileExists(TempDir + '\bg.pak') and
FileExists(TempDir + '\bn.pak') and Result := FileExists(TempDir + 'am.pak') and
FileExists(TempDir + '\ca.pak') and FileExists(TempDir + 'ar.pak') and
FileExists(TempDir + '\cs.pak') and FileExists(TempDir + 'bg.pak') and
FileExists(TempDir + '\da.pak') and FileExists(TempDir + 'bn.pak') and
FileExists(TempDir + '\de.pak') and FileExists(TempDir + 'ca.pak') and
FileExists(TempDir + '\el.pak') and FileExists(TempDir + 'cs.pak') and
FileExists(TempDir + '\en-GB.pak') and FileExists(TempDir + 'da.pak') and
FileExists(TempDir + '\en-US.pak') and FileExists(TempDir + 'de.pak') and
FileExists(TempDir + '\es.pak') and FileExists(TempDir + 'el.pak') and
FileExists(TempDir + '\es-419.pak') and FileExists(TempDir + 'en-GB.pak') and
FileExists(TempDir + '\et.pak') and FileExists(TempDir + 'en-US.pak') and
FileExists(TempDir + '\fa.pak') and FileExists(TempDir + 'es.pak') and
FileExists(TempDir + '\fi.pak') and FileExists(TempDir + 'es-419.pak') and
FileExists(TempDir + '\fil.pak') and FileExists(TempDir + 'et.pak') and
FileExists(TempDir + '\fr.pak') and FileExists(TempDir + 'fa.pak') and
FileExists(TempDir + '\gu.pak') and FileExists(TempDir + 'fi.pak') and
FileExists(TempDir + '\he.pak') and FileExists(TempDir + 'fil.pak') and
FileExists(TempDir + '\hi.pak') and FileExists(TempDir + 'fr.pak') and
FileExists(TempDir + '\hr.pak') and FileExists(TempDir + 'gu.pak') and
FileExists(TempDir + '\hu.pak') and FileExists(TempDir + 'he.pak') and
FileExists(TempDir + '\id.pak') and FileExists(TempDir + 'hi.pak') and
FileExists(TempDir + '\it.pak') and FileExists(TempDir + 'hr.pak') and
FileExists(TempDir + '\ja.pak') and FileExists(TempDir + 'hu.pak') and
FileExists(TempDir + '\kn.pak') and FileExists(TempDir + 'id.pak') and
FileExists(TempDir + '\ko.pak') and FileExists(TempDir + 'it.pak') and
FileExists(TempDir + '\lt.pak') and FileExists(TempDir + 'ja.pak') and
FileExists(TempDir + '\lv.pak') and FileExists(TempDir + 'kn.pak') and
FileExists(TempDir + '\ml.pak') and FileExists(TempDir + 'ko.pak') and
FileExists(TempDir + '\mr.pak') and FileExists(TempDir + 'lt.pak') and
FileExists(TempDir + '\ms.pak') and FileExists(TempDir + 'lv.pak') and
FileExists(TempDir + '\nb.pak') and FileExists(TempDir + 'ml.pak') and
FileExists(TempDir + '\nl.pak') and FileExists(TempDir + 'mr.pak') and
FileExists(TempDir + '\pl.pak') and FileExists(TempDir + 'ms.pak') and
FileExists(TempDir + '\pt-BR.pak') and FileExists(TempDir + 'nb.pak') and
FileExists(TempDir + '\pt-PT.pak') and FileExists(TempDir + 'nl.pak') and
FileExists(TempDir + '\ro.pak') and FileExists(TempDir + 'pl.pak') and
FileExists(TempDir + '\ru.pak') and FileExists(TempDir + 'pt-BR.pak') and
FileExists(TempDir + '\sk.pak') and FileExists(TempDir + 'pt-PT.pak') and
FileExists(TempDir + '\sl.pak') and FileExists(TempDir + 'ro.pak') and
FileExists(TempDir + '\sr.pak') and FileExists(TempDir + 'ru.pak') and
FileExists(TempDir + '\sv.pak') and FileExists(TempDir + 'sk.pak') and
FileExists(TempDir + '\sw.pak') and FileExists(TempDir + 'sl.pak') and
FileExists(TempDir + '\ta.pak') and FileExists(TempDir + 'sr.pak') and
FileExists(TempDir + '\te.pak') and FileExists(TempDir + 'sv.pak') and
FileExists(TempDir + '\th.pak') and FileExists(TempDir + 'sw.pak') and
FileExists(TempDir + '\tr.pak') and FileExists(TempDir + 'ta.pak') and
FileExists(TempDir + '\uk.pak') and FileExists(TempDir + 'te.pak') and
FileExists(TempDir + '\vi.pak') and FileExists(TempDir + 'th.pak') and
FileExists(TempDir + '\zh-CN.pak') and FileExists(TempDir + 'tr.pak') and
FileExists(TempDir + '\zh-TW.pak'); FileExists(TempDir + 'uk.pak') and
FileExists(TempDir + 'vi.pak') and
FileExists(TempDir + 'zh-CN.pak') and
FileExists(TempDir + 'zh-TW.pak');
end;
except except
on e : exception do on e : exception do
OutputDebugMessage('TCefApplication.CheckLocales error: ' + e.Message); OutputDebugMessage('TCefApplication.CheckLocales error: ' + e.Message);
@ -571,6 +584,12 @@ begin
begin begin
TempDir := FResourcesDirPath; TempDir := FResourcesDirPath;
if (TempDir[length(TempDir)] <> '\') then TempDir := TempDir + '\'; if (TempDir[length(TempDir)] <> '\') then TempDir := TempDir + '\';
end
else
exit;
end
else
TempDir := '';
Result := FileExists(TempDir + 'cef.pak') and Result := FileExists(TempDir + 'cef.pak') and
FileExists(TempDir + 'cef_100_percent.pak') and FileExists(TempDir + 'cef_100_percent.pak') and
@ -578,14 +597,6 @@ begin
FileExists(TempDir + 'cef_extensions.pak') and FileExists(TempDir + 'cef_extensions.pak') and
FileExists(TempDir + 'devtools_resources.pak'); FileExists(TempDir + 'devtools_resources.pak');
end; end;
end
else
Result := FileExists('cef.pak') and
FileExists('cef_100_percent.pak') and
FileExists('cef_200_percent.pak') and
FileExists('cef_extensions.pak') and
FileExists('devtools_resources.pak');
end;
except except
on e : exception do on e : exception do
OutputDebugMessage('TCefApplication.CheckResources error: ' + e.Message); OutputDebugMessage('TCefApplication.CheckResources error: ' + e.Message);
@ -600,7 +611,7 @@ begin
Result := FileExists('chrome_elf.dll') and Result := FileExists('chrome_elf.dll') and
FileExists('d3dcompiler_43.dll') and FileExists('d3dcompiler_43.dll') and
FileExists('d3dcompiler_47.dll') and FileExists('d3dcompiler_47.dll') and
FileExists('libcef.dll') and FileExists(FLibCef) and
FileExists('libEGL.dll') and FileExists('libEGL.dll') and
FileExists('libGLESv2.dll') and FileExists('libGLESv2.dll') and
FileExists('widevinecdmadapter.dll'); FileExists('widevinecdmadapter.dll');
@ -624,7 +635,7 @@ begin
CheckResources and CheckResources and
CheckLocales then CheckLocales then
begin begin
TempVersion := GetFileVersion('libcef.dll'); TempVersion := GetFileVersion(FLibCef);
UInt64ToFileVersionInfo(TempVersion, TempVersionInfo); UInt64ToFileVersionInfo(TempVersion, TempVersionInfo);
if (TempVersionInfo.MajorVer = CEF_SUPPORTED_VERSION_MAJOR) and if (TempVersionInfo.MajorVer = CEF_SUPPORTED_VERSION_MAJOR) and
@ -742,8 +753,8 @@ begin
Result := False; Result := False;
try try
if FDeleteCache and (length(FCache) > 0) then TDirectory.Delete(FCache, True); if FDeleteCache then DeleteDirContents(FCache);
if FDeleteCookies and (length(FCookies) > 0) then TDirectory.Delete(FCookies, True); if FDeleteCookies then DeleteDirContents(FCookies);
InitializeSettings(TempSettings); InitializeSettings(TempSettings);
Result := (cef_initialize(@HInstance, @TempSettings, FApp.Wrap, FWindowsSandboxInfo) <> 0); Result := (cef_initialize(@HInstance, @TempSettings, FApp.Wrap, FWindowsSandboxInfo) <> 0);
@ -753,6 +764,42 @@ begin
end; end;
end; end;
procedure TCefApplication.DeleteDirContents(const aDirectory : string);
{$IFNDEF DELPHI12_UP}
var
TempRec : TSearchRec;
{$ENDIF}
begin
try
if (length(aDirectory) > 0) and DirectoryExists(aDirectory) then
begin
{$IFDEF DELPHI12_UP}
TDirectory.Delete(aDirectory, True);
{$ELSE}
if (FindFirst(aDirectory + '\*', faAnyFile, TempRec) = 0) then
begin
try
repeat
if ((TempRec.Attr and faDirectory) <> 0) then
begin
if (TempRec.Name <> '.') and (TempRec.Name <> '..') then
DeleteDirContents(aDirectory + '\' + TempRec.Name)
end
else
DeleteFile(aDirectory + '\' + TempRec.Name);
until (FindNext(TempRec) <> 0);
finally
FindClose(TempRec);
end;
end;
{$ENDIF}
end;
except
on e : exception do
OutputDebugMessage('TCefApplication.DeleteDirContents error: ' + e.Message);
end;
end;
procedure TCefApplication.App_OnBeforeCommandLineProc(const processType : ustring; procedure TCefApplication.App_OnBeforeCommandLineProc(const processType : ustring;
const commandLine : ICefCommandLine); const commandLine : ICefCommandLine);
var var
@ -767,14 +814,21 @@ begin
commandLine.AppendSwitch('--enable-system-flash'); commandLine.AppendSwitch('--enable-system-flash');
end; end;
if (FCustomCommandLines <> nil) then if (FCustomCommandLines <> nil) and
(FCustomCommandLineValues <> nil) and
(FCustomCommandLines.Count = FCustomCommandLineValues.Count) then
begin begin
i := 0; i := 0;
while (i < FCustomCommandLines.Count) do while (i < FCustomCommandLines.Count) do
begin begin
if (length(FCustomCommandLines[i]) > 0) then if (length(FCustomCommandLines[i]) > 0) then
begin
if (length(FCustomCommandLineValues[i]) > 0) then
commandLine.AppendSwitchWithValue(FCustomCommandLines[i], FCustomCommandLineValues[i])
else
commandLine.AppendSwitch(FCustomCommandLines[i]); commandLine.AppendSwitch(FCustomCommandLines[i]);
end;
inc(i); inc(i);
end; end;
@ -804,7 +858,7 @@ end;
function TCefApplication.LoadCEFlibrary : boolean; function TCefApplication.LoadCEFlibrary : boolean;
begin begin
FLibHandle := LoadLibrary(PChar('libcef.dll')); FLibHandle := LoadLibrary(PChar(FLibCef));
if (FLibHandle = 0) then if (FLibHandle = 0) then
begin begin

View File

@ -47,7 +47,7 @@ unit uCEFBinaryValue;
interface interface
uses uses
uCEFBase, uCEFInterfaces; uCEFBase, uCEFInterfaces, uCEFTypes;
type type
TCefBinaryValueRef = class(TCefBaseRef, ICefBinaryValue) TCefBinaryValueRef = class(TCefBaseRef, ICefBinaryValue)
@ -68,7 +68,7 @@ type
implementation implementation
uses uses
uCEFMiscFunctions, uCEFLibFunctions, uCEFTypes; uCEFMiscFunctions, uCEFLibFunctions;
function TCefBinaryValueRef.Copy: ICefBinaryValue; function TCefBinaryValueRef.Copy: ICefBinaryValue;
begin begin

View File

@ -58,7 +58,7 @@ type
constructor Create; virtual; constructor Create; virtual;
end; end;
TOnLocationUpdate = reference to procedure(const position: PCefGeoposition); TOnLocationUpdate = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const position: PCefGeoposition);
TCefFastGetGeolocationCallback = class(TCefGetGeolocationCallbackOwn) TCefFastGetGeolocationCallback = class(TCefGetGeolocationCallbackOwn)
protected protected

View File

@ -95,17 +95,19 @@ type
TCefv8ValueArray = array of ICefv8Value; TCefv8ValueArray = array of ICefv8Value;
TCefX509CertificateArray = array of ICefX509Certificate; TCefX509CertificateArray = array of ICefX509Certificate;
TOnPdfPrintFinishedProc = reference to procedure(const path: ustring; ok: Boolean); TOnPdfPrintFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; ok: Boolean);
TCefDomVisitorProc = reference to procedure(const document: ICefDomDocument); TCefDomVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const document: ICefDomDocument);
TCefStringVisitorProc = reference to procedure(const str: ustring); TCefStringVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const str: ustring);
TOnRegisterCustomSchemes = reference to procedure(const registrar: ICefSchemeRegistrar);
TOnGetResourceBundleHandler = reference to procedure(var aCefResourceBundleHandler : ICefResourceBundleHandler); TOnRegisterCustomSchemes = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const registrar: ICefSchemeRegistrar) {$IFNDEF DELPHI12_UP}of object{$ENDIF};
TOnGetBrowserProcessHandler = reference to procedure(var aCefBrowserProcessHandler : ICefBrowserProcessHandler); TOnGetResourceBundleHandler = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(var aCefResourceBundleHandler : ICefResourceBundleHandler) {$IFNDEF DELPHI12_UP}of object{$ENDIF};
TOnGetRenderProcessHandler = reference to procedure(var aCefRenderProcessHandler : ICefRenderProcessHandler); TOnGetBrowserProcessHandler = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(var aCefBrowserProcessHandler : ICefBrowserProcessHandler) {$IFNDEF DELPHI12_UP}of object{$ENDIF};
TOnBeforeCommandLineProcessing = reference to procedure(const processType: ustring; const commandLine: ICefCommandLine); TOnGetRenderProcessHandler = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(var aCefRenderProcessHandler : ICefRenderProcessHandler) {$IFNDEF DELPHI12_UP}of object{$ENDIF};
TCefCompletionCallbackProc = reference to procedure; TOnBeforeCommandLineProcessing = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const processType: ustring; const commandLine: ICefCommandLine) {$IFNDEF DELPHI12_UP}of object{$ENDIF};
TCefSetCookieCallbackProc = reference to procedure(success: Boolean);
TCefDeleteCookiesCallbackProc = reference to procedure(numDeleted: Integer); TCefCompletionCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure;
TCefSetCookieCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(success: Boolean);
TCefDeleteCookiesCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(numDeleted: Integer);
@ -119,7 +121,7 @@ type
procedure OnFileDialogDismissed(selectedAcceptFilter: Integer; filePaths: TStrings); procedure OnFileDialogDismissed(selectedAcceptFilter: Integer; filePaths: TStrings);
end; end;
TCefRunFileDialogCallbackProc = reference to TCefRunFileDialogCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF}
procedure(selectedAcceptFilter: Integer; filePaths: TStrings); procedure(selectedAcceptFilter: Integer; filePaths: TStrings);
ICefNavigationEntryVisitor = interface(ICefBase) ICefNavigationEntryVisitor = interface(ICefBase)
@ -128,7 +130,7 @@ type
current: Boolean; index, total: Integer): Boolean; current: Boolean; index, total: Integer): Boolean;
end; end;
TCefNavigationEntryVisitorProc = reference to TCefNavigationEntryVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF}
function(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer): Boolean; function(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer): Boolean;
ICefPdfPrintCallback = interface(ICefBase) ICefPdfPrintCallback = interface(ICefBase)
@ -136,7 +138,7 @@ type
procedure OnPdfPrintFinished(const path: ustring; ok: Boolean); procedure OnPdfPrintFinished(const path: ustring; ok: Boolean);
end; end;
TOnDownloadImageFinishedProc = reference to TOnDownloadImageFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF}
procedure(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage); procedure(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage);
ICefDownloadImageCallback = interface(ICefBase) ICefDownloadImageCallback = interface(ICefBase)
@ -872,7 +874,7 @@ type
function GetRenderProcessHandler: ICefRenderProcessHandler; function GetRenderProcessHandler: ICefRenderProcessHandler;
end; end;
TCefCookieVisitorProc = reference to function( TCefCookieVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(
const name, value, domain, path: ustring; secure, httponly, const name, value, domain, path: ustring; secure, httponly,
hasExpires: Boolean; const creation, lastAccess, expires: TDateTime; hasExpires: Boolean; const creation, lastAccess, expires: TDateTime;
count, total: Integer; out deleteCookie: Boolean): Boolean; count, total: Integer; out deleteCookie: Boolean): Boolean;

View File

@ -193,13 +193,13 @@ begin
cef_string_utf16_clear(@str); cef_string_utf16_clear(@str);
end; end;
function CefGetObject(ptr: Pointer): TObject; inline; function CefGetObject(ptr: Pointer): TObject; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
begin begin
Dec(PByte(ptr), SizeOf(Pointer)); Dec(PByte(ptr), SizeOf(Pointer));
Result := TObject(PPointer(ptr)^); Result := TObject(PPointer(ptr)^);
end; end;
function CefGetData(const i: ICefBase): Pointer; inline; function CefGetData(const i: ICefBase): Pointer; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
begin begin
if (i <> nil) then if (i <> nil) then
Result := i.Wrap Result := i.Wrap
@ -442,7 +442,7 @@ const
DEFAULT_LINE = 1; DEFAULT_LINE = 1;
begin begin
{$IFDEF DEBUG} {$IFDEF DEBUG}
OutputDebugString(PWideChar(aMessage + chr(0))); OutputDebugString({$IFDEF DELPHI12_UP}PWideChar{$ELSE}PAnsiChar{$ENDIF}(aMessage + chr(0)));
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
CefLog('CEF4Delphi', DEFAULT_LINE, CEF_LOG_SEVERITY_ERROR, aMessage); CefLog('CEF4Delphi', DEFAULT_LINE, CEF_LOG_SEVERITY_ERROR, aMessage);

View File

@ -50,7 +50,7 @@ uses
uCEFBase, uCEFInterfaces, uCEFTypes; uCEFBase, uCEFInterfaces, uCEFTypes;
type type
TCefRegisterCDMProc = reference to procedure(result: TCefCDMRegistrationError; const error_message: ustring); TCefRegisterCDMProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(result: TCefCDMRegistrationError; const error_message: ustring);
TCefRegisterCDMCallbackOwn = class(TCefBaseOwn, ICefRegisterCDMCallback) TCefRegisterCDMCallbackOwn = class(TCefBaseOwn, ICefRegisterCDMCallback)
protected protected

View File

@ -50,7 +50,7 @@ uses
uCEFBase, uCEFInterfaces, uCEFTypes; uCEFBase, uCEFInterfaces, uCEFTypes;
type type
TCefRequestContextHandlerProc = reference to function: ICefCookieManager; TCefRequestContextHandlerProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function: ICefCookieManager;
TCefRequestContextHandlerRef = class(TCefBaseRef, ICefRequestContextHandler) TCefRequestContextHandlerRef = class(TCefBaseRef, ICefRequestContextHandler)
protected protected

View File

@ -60,9 +60,9 @@ type
constructor Create; virtual; constructor Create; virtual;
end; end;
TGetDataResource = reference to function(resourceId: Integer; out data: Pointer; out dataSize: NativeUInt): Boolean; TGetDataResource = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(resourceId: Integer; out data: Pointer; out dataSize: NativeUInt): Boolean;
TGetLocalizedString = reference to function(stringId: Integer; out stringVal: ustring): Boolean; TGetLocalizedString = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(stringId: Integer; out stringVal: ustring): Boolean;
TGetDataResourceForScale = reference to function(resourceId: Integer; scaleFactor: TCefScaleFactor; out data: Pointer; out dataSize: NativeUInt): Boolean; TGetDataResourceForScale = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(resourceId: Integer; scaleFactor: TCefScaleFactor; out data: Pointer; out dataSize: NativeUInt): Boolean;
TCefFastResourceBundle = class(TCefResourceBundleHandlerOwn) TCefFastResourceBundle = class(TCefResourceBundleHandlerOwn)
protected protected

View File

@ -66,7 +66,7 @@ type
class function UnWrap(data: Pointer): ICefTask; class function UnWrap(data: Pointer): ICefTask;
end; end;
TCefFastTaskProc = reference to procedure; TCefFastTaskProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure;
TCefFastTask = class(TCefTaskOwn) TCefFastTask = class(TCefTaskOwn)
protected protected

View File

@ -216,8 +216,17 @@ type
TCefDomEventCategory = Integer; // /include/internal/cef_types.h (cef_dom_event_category_t) TCefDomEventCategory = Integer; // /include/internal/cef_types.h (cef_dom_event_category_t)
{$IFNDEF DELPHI12_UP}
NativeUInt = Cardinal;
PNativeUInt = ^NativeUInt;
NativeInt = Integer;
uint16 = Word;
ustring = type WideString;
rbstring = type AnsiString;
{$ELSE}
ustring = type string; ustring = type string;
rbstring = type RawByteString; rbstring = type RawByteString;
{$ENDIF}
Char16 = WideChar; Char16 = WideChar;
PChar16 = PWideChar; PChar16 = PWideChar;

View File

@ -58,7 +58,7 @@ type
constructor Create; virtual; constructor Create; virtual;
end; end;
TCefWebPluginInfoVisitorProc = reference to function(const info: ICefWebPluginInfo; count, total: Integer): Boolean; TCefWebPluginInfoVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const info: ICefWebPluginInfo; count, total: Integer): Boolean;
TCefFastWebPluginInfoVisitor = class(TCefWebPluginInfoVisitorOwn) TCefFastWebPluginInfoVisitor = class(TCefWebPluginInfoVisitorOwn)
protected protected

View File

@ -50,7 +50,7 @@ uses
uCEFBase, uCEFInterfaces, uCEFTypes; uCEFBase, uCEFInterfaces, uCEFTypes;
type type
TCefWebPluginIsUnstableProc = reference to procedure(const path: ustring; unstable: Boolean); TCefWebPluginIsUnstableProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; unstable: Boolean);
TCefWebPluginUnstableCallbackOwn = class(TCefBaseOwn, ICefWebPluginUnstableCallback) TCefWebPluginUnstableCallbackOwn = class(TCefBaseOwn, ICefWebPluginUnstableCallback)
protected protected

View File

@ -51,7 +51,10 @@ uses
System.Rtti, System.TypInfo, System.Variants, System.SysUtils, System.Rtti, System.TypInfo, System.Variants, System.SysUtils,
System.Classes, System.Math, System.SyncObjs, WinApi.Windows, System.Classes, System.Math, System.SyncObjs, WinApi.Windows,
{$ELSE} {$ELSE}
Rtti, TypInfo, Variants, SysUtils, Classes, Math, SyncObjs, Windows, {$IFDEF DELPHI12_UP}
Rtti,
{$ENDIF}
TypInfo, Variants, SysUtils, Classes, Math, SyncObjs, Windows,
{$ENDIF} {$ENDIF}
uCEFBase, uCEFInterfaces, uCEFTypes; uCEFBase, uCEFInterfaces, uCEFTypes;
@ -72,6 +75,7 @@ type
constructor Create; virtual; constructor Create; virtual;
end; end;
{$IFDEF DELPHI14_UP}
TCefRTTIExtension = class(TCefv8HandlerOwn) TCefRTTIExtension = class(TCefv8HandlerOwn)
protected protected
FValue: TValue; FValue: TValue;
@ -91,6 +95,7 @@ type
destructor Destroy; override; destructor Destroy; override;
class procedure Register(const name: string; const value: TValue; SyncMainThread: Boolean = False); class procedure Register(const name: string; const value: TValue; SyncMainThread: Boolean = False);
end; end;
{$ENDIF}
implementation implementation
@ -161,6 +166,8 @@ begin
Result := False; Result := False;
end; end;
{$IFDEF DELPHI14_UP}
// TCefRTTIExtension // TCefRTTIExtension
constructor TCefRTTIExtension.Create(const value: TValue; SyncMainThread: Boolean); constructor TCefRTTIExtension.Create(const value: TValue; SyncMainThread: Boolean);
@ -906,5 +913,6 @@ begin
end else end else
Exit(False); Exit(False);
end; end;
{$ENDIF}
end. end.

View File

@ -55,13 +55,13 @@ uses
uCEFInterfaces, uCEFTypes; uCEFInterfaces, uCEFTypes;
type type
TCefV8AccessorGetterProc = reference to function(const name: ustring; const obj: ICefv8Value; out value: ICefv8Value; const exception: ustring): Boolean; TCefV8AccessorGetterProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const obj: ICefv8Value; out value: ICefv8Value; const exception: ustring): Boolean;
TCefV8AccessorSetterProc = reference to function(const name: ustring; const obj, value: ICefv8Value; const exception: ustring): Boolean; TCefV8AccessorSetterProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const obj, value: ICefv8Value; const exception: ustring): Boolean;
TCefV8InterceptorGetterByNameProc = reference to function(const name: ustring; const obj: ICefv8Value; out value: ICefv8Value; const exception: ustring): Boolean; TCefV8InterceptorGetterByNameProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const obj: ICefv8Value; out value: ICefv8Value; const exception: ustring): Boolean;
TCefV8InterceptorSetterByNameProc = reference to function(const name: ustring; const obj, value: ICefv8Value; const exception: ustring): Boolean; TCefV8InterceptorSetterByNameProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const obj, value: ICefv8Value; const exception: ustring): Boolean;
TCefV8InterceptorGetterByIndexProc = reference to function(index: integer; const obj: ICefv8Value; out value: ICefv8Value; const exception: ustring): Boolean; TCefV8InterceptorGetterByIndexProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(index: integer; const obj: ICefv8Value; out value: ICefv8Value; const exception: ustring): Boolean;
TCefV8InterceptorSetterByIndexProc = reference to function(index: integer; const obj, value: ICefv8Value; const exception: ustring): Boolean; TCefV8InterceptorSetterByIndexProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(index: integer; const obj, value: ICefv8Value; const exception: ustring): Boolean;
implementation implementation