You've already forked CEF4Delphi
							
							
				mirror of
				https://github.com/salvadordf/CEF4Delphi.git
				synced 2025-10-30 23:07:52 +02:00 
			
		
		
		
	Update to CEF 3.3325.1758.g9aea513 and new SimpleFMXBrowser demo
This commit is contained in:
		
							
								
								
									
										14
									
								
								demos/SimpleFMXBrowser/00-DeleteDCUs.bat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								demos/SimpleFMXBrowser/00-DeleteDCUs.bat
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| del /s /q *.dcu | ||||
| del /s /q *.exe | ||||
| del /s /q *.res | ||||
| del /s /q *.log | ||||
| del /s /q *.dsk | ||||
| del /s /q *.identcache | ||||
| del /s /q *.stat | ||||
| del /s /q *.local | ||||
| del /s /q *.~* | ||||
| rmdir Win32\Debug | ||||
| rmdir Win32\Release | ||||
| rmdir Win32 | ||||
| rmdir __history | ||||
| rmdir __recovery | ||||
							
								
								
									
										47
									
								
								demos/SimpleFMXBrowser/SimpleFMXBrowser.dpr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								demos/SimpleFMXBrowser/SimpleFMXBrowser.dpr
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,47 @@ | ||||
| program SimpleFMXBrowser; | ||||
|  | ||||
| uses | ||||
|   System.StartUpCopy, | ||||
|   FMX.Forms, | ||||
|   {$IFDEF MSWINDOWS} | ||||
|   WinApi.Windows, | ||||
|   {$ENDIF } | ||||
|   uCEFApplication, | ||||
|   uSimpleFMXBrowser in 'uSimpleFMXBrowser.pas' {SimpleFMXBrowserFrm}, | ||||
|   uFMXApplicationService in 'uFMXApplicationService.pas'; | ||||
|  | ||||
| {$R *.res} | ||||
|  | ||||
| {$IFDEF MSWINDOWS} | ||||
| // CEF3 needs to set the LARGEADDRESSAWARE flag which allows 32-bit processes to use up to 3GB of RAM. | ||||
| {$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE} | ||||
| {$ENDIF} | ||||
|  | ||||
| begin | ||||
|   GlobalCEFApp := TCefApplication.Create; | ||||
|  | ||||
|   // In case you want to use custom directories for the CEF3 binaries, cache, cookies and user data. | ||||
|   // If you don't set a cache directory the browser will use in-memory cache. | ||||
| { | ||||
|   GlobalCEFApp.FrameworkDirPath     := 'cef'; | ||||
|   GlobalCEFApp.ResourcesDirPath     := 'cef'; | ||||
|   GlobalCEFApp.LocalesDirPath       := 'cef\locales'; | ||||
|   GlobalCEFApp.EnableGPU            := True;      // Enable hardware acceleration | ||||
|   GlobalCEFApp.DisableGPUCache      := True;      // Disable the creation of a 'GPUCache' directory in the hard drive. | ||||
|   GlobalCEFApp.cache                := 'cef\cache'; | ||||
|   GlobalCEFApp.cookies              := 'cef\cookies'; | ||||
|   GlobalCEFApp.UserDataPath         := 'cef\User Data'; | ||||
| } | ||||
|  | ||||
|   // You *MUST* call GlobalCEFApp.StartMainProcess in a if..then clause | ||||
|   // with the Application initialization inside the begin..end. | ||||
|   // Read this https://www.briskbard.com/index.php?lang=en&pageid=cef | ||||
|   if GlobalCEFApp.StartMainProcess then | ||||
|     begin | ||||
|       Application.Initialize; | ||||
|       Application.CreateForm(TSimpleFMXBrowserFrm, SimpleFMXBrowserFrm); | ||||
|       Application.Run; | ||||
|     end; | ||||
|  | ||||
|   GlobalCEFApp.Free; | ||||
| end. | ||||
							
								
								
									
										619
									
								
								demos/SimpleFMXBrowser/SimpleFMXBrowser.dproj
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										619
									
								
								demos/SimpleFMXBrowser/SimpleFMXBrowser.dproj
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,619 @@ | ||||
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||||
|     <PropertyGroup> | ||||
|         <ProjectGuid>{5967B4A4-5E6D-420E-B524-A52A1240AC82}</ProjectGuid> | ||||
|         <ProjectVersion>18.2</ProjectVersion> | ||||
|         <FrameworkType>FMX</FrameworkType> | ||||
|         <MainSource>SimpleFMXBrowser.dpr</MainSource> | ||||
|         <Base>True</Base> | ||||
|         <Config Condition="'$(Config)'==''">Debug</Config> | ||||
|         <Platform Condition="'$(Platform)'==''">Win32</Platform> | ||||
|         <TargetedPlatforms>3</TargetedPlatforms> | ||||
|         <AppType>Application</AppType> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''"> | ||||
|         <Base>true</Base> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''"> | ||||
|         <Base_Win32>true</Base_Win32> | ||||
|         <CfgParent>Base</CfgParent> | ||||
|         <Base>true</Base> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''"> | ||||
|         <Base_Win64>true</Base_Win64> | ||||
|         <CfgParent>Base</CfgParent> | ||||
|         <Base>true</Base> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''"> | ||||
|         <Cfg_1>true</Cfg_1> | ||||
|         <CfgParent>Base</CfgParent> | ||||
|         <Base>true</Base> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''"> | ||||
|         <Cfg_1_Win32>true</Cfg_1_Win32> | ||||
|         <CfgParent>Cfg_1</CfgParent> | ||||
|         <Cfg_1>true</Cfg_1> | ||||
|         <Base>true</Base> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''"> | ||||
|         <Cfg_1_Win64>true</Cfg_1_Win64> | ||||
|         <CfgParent>Cfg_1</CfgParent> | ||||
|         <Cfg_1>true</Cfg_1> | ||||
|         <Base>true</Base> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''"> | ||||
|         <Cfg_2>true</Cfg_2> | ||||
|         <CfgParent>Base</CfgParent> | ||||
|         <Base>true</Base> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''"> | ||||
|         <Cfg_2_Win32>true</Cfg_2_Win32> | ||||
|         <CfgParent>Cfg_2</CfgParent> | ||||
|         <Cfg_2>true</Cfg_2> | ||||
|         <Base>true</Base> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''"> | ||||
|         <Cfg_2_Win64>true</Cfg_2_Win64> | ||||
|         <CfgParent>Cfg_2</CfgParent> | ||||
|         <Cfg_2>true</Cfg_2> | ||||
|         <Base>true</Base> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Base)'!=''"> | ||||
|         <DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput> | ||||
|         <DCC_ExeOutput>..\..\bin</DCC_ExeOutput> | ||||
|         <DCC_E>false</DCC_E> | ||||
|         <DCC_N>false</DCC_N> | ||||
|         <DCC_S>false</DCC_S> | ||||
|         <DCC_F>false</DCC_F> | ||||
|         <DCC_K>false</DCC_K> | ||||
|         <DCC_UsePackage>RESTComponents;emsclientfiredac;FireDAC;FireDACSqliteDriver;soaprtl;FireDACIBDriver;soapmidas;FireDACCommon;emsclient;RESTBackendComponents;soapserver;FireDACCommonDriver;CloudService;inet;$(DCC_UsePackage)</DCC_UsePackage> | ||||
|         <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace> | ||||
|         <Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon> | ||||
|         <Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns> | ||||
|         <SanitizedProjectName>SimpleFMXBrowser</SanitizedProjectName> | ||||
|         <VerInfo_Locale>3082</VerInfo_Locale> | ||||
|         <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Base_Win32)'!=''"> | ||||
|         <DCC_UsePackage>DBXSqliteDriver;bindcompdbx;fmxase;DBXDb2Driver;DBXInterBaseDriver;vcl;DBXSybaseASEDriver;vclactnband;vclFireDAC;FireDACDb2Driver;DataSnapFireDAC;svnui;tethering;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;DBXMSSQLDriver;vclimg;FireDACInfxDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;FireDACPgDriver;DBXOracleDriver;inetdb;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;DbxCommonDriver;IndyProtocols240;IndySystem240;fmx;DataSnapServer;xmlrtl;DataSnapNativeClient;fmxobj;fmxdae;vclwinx;rtl;FireDACDSDriver;DbxClientDriver;IndyCore240;DBXSybaseASADriver;CustomIPTransport;vcldsnap;dbexpress;FireDACDBXDriver;vclx;bindcomp;appanalytics;dsnap;DataSnapCommon;DBXInformixDriver;bindcompvcl;DataSnapConnectors;VCLRESTComponents;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;vclie;CEF4Delphi_FMX;bindengine;DBXMySQLDriver;FireDACOracleDriver;dsnapxml;FireDACMySQLDriver;dbrtl;inetdbxpress;DBXFirebirdDriver;DataSnapProviderClient;FireDACMongoDBDriver;FireDACCommonODBC;DataSnapClient;DataSnapServerMidas;$(DCC_UsePackage)</DCC_UsePackage> | ||||
|         <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace> | ||||
|         <BT_BuildType>Debug</BT_BuildType> | ||||
|         <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> | ||||
|         <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> | ||||
|         <VerInfo_Locale>1033</VerInfo_Locale> | ||||
|         <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File> | ||||
|         <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44> | ||||
|         <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Base_Win64)'!=''"> | ||||
|         <DCC_UsePackage>DBXSqliteDriver;bindcompdbx;fmxase;DBXDb2Driver;DBXInterBaseDriver;vcl;DBXSybaseASEDriver;vclactnband;vclFireDAC;FireDACDb2Driver;DataSnapFireDAC;tethering;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;DBXMSSQLDriver;vclimg;FireDACInfxDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;FireDACPgDriver;DBXOracleDriver;inetdb;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;DbxCommonDriver;IndyProtocols240;IndySystem240;fmx;DataSnapServer;xmlrtl;DataSnapNativeClient;fmxobj;fmxdae;vclwinx;rtl;FireDACDSDriver;DbxClientDriver;IndyCore240;DBXSybaseASADriver;CustomIPTransport;vcldsnap;dbexpress;FireDACDBXDriver;vclx;bindcomp;appanalytics;dsnap;DataSnapCommon;DBXInformixDriver;bindcompvcl;DataSnapConnectors;VCLRESTComponents;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;dsnapxml;FireDACMySQLDriver;dbrtl;inetdbxpress;DBXFirebirdDriver;DataSnapProviderClient;FireDACMongoDBDriver;FireDACCommonODBC;DataSnapClient;DataSnapServerMidas;$(DCC_UsePackage)</DCC_UsePackage> | ||||
|         <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace> | ||||
|         <BT_BuildType>Debug</BT_BuildType> | ||||
|         <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> | ||||
|         <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> | ||||
|         <VerInfo_Locale>1033</VerInfo_Locale> | ||||
|         <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File> | ||||
|         <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44> | ||||
|         <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Cfg_1)'!=''"> | ||||
|         <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define> | ||||
|         <DCC_DebugDCUs>true</DCC_DebugDCUs> | ||||
|         <DCC_Optimize>false</DCC_Optimize> | ||||
|         <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames> | ||||
|         <DCC_DebugInfoInExe>true</DCC_DebugInfoInExe> | ||||
|         <DCC_RemoteDebug>true</DCC_RemoteDebug> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''"> | ||||
|         <DCC_RemoteDebug>false</DCC_RemoteDebug> | ||||
|         <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes> | ||||
|         <AppEnableHighDPI>true</AppEnableHighDPI> | ||||
|         <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> | ||||
|         <VerInfo_Locale>1033</VerInfo_Locale> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''"> | ||||
|         <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes> | ||||
|         <AppEnableHighDPI>true</AppEnableHighDPI> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Cfg_2)'!=''"> | ||||
|         <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols> | ||||
|         <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define> | ||||
|         <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo> | ||||
|         <DCC_DebugInformation>0</DCC_DebugInformation> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''"> | ||||
|         <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes> | ||||
|         <AppEnableHighDPI>true</AppEnableHighDPI> | ||||
|     </PropertyGroup> | ||||
|     <PropertyGroup Condition="'$(Cfg_2_Win64)'!=''"> | ||||
|         <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes> | ||||
|         <AppEnableHighDPI>true</AppEnableHighDPI> | ||||
|     </PropertyGroup> | ||||
|     <ItemGroup> | ||||
|         <DelphiCompile Include="$(MainSource)"> | ||||
|             <MainSource>MainSource</MainSource> | ||||
|         </DelphiCompile> | ||||
|         <DCCReference Include="uSimpleFMXBrowser.pas"> | ||||
|             <Form>SimpleFMXBrowserFrm</Form> | ||||
|             <FormType>fmx</FormType> | ||||
|         </DCCReference> | ||||
|         <DCCReference Include="uFMXApplicationService.pas"/> | ||||
|         <BuildConfiguration Include="Release"> | ||||
|             <Key>Cfg_2</Key> | ||||
|             <CfgParent>Base</CfgParent> | ||||
|         </BuildConfiguration> | ||||
|         <BuildConfiguration Include="Base"> | ||||
|             <Key>Base</Key> | ||||
|         </BuildConfiguration> | ||||
|         <BuildConfiguration Include="Debug"> | ||||
|             <Key>Cfg_1</Key> | ||||
|             <CfgParent>Base</CfgParent> | ||||
|         </BuildConfiguration> | ||||
|     </ItemGroup> | ||||
|     <ProjectExtensions> | ||||
|         <Borland.Personality>Delphi.Personality.12</Borland.Personality> | ||||
|         <Borland.ProjectType>Application</Borland.ProjectType> | ||||
|         <BorlandProject> | ||||
|             <Delphi.Personality> | ||||
|                 <Source> | ||||
|                     <Source Name="MainSource">SimpleFMXBrowser.dpr</Source> | ||||
|                 </Source> | ||||
|                 <Excluded_Packages> | ||||
|                     <Excluded_Packages Name="$(BDSBIN)\dclIPIndyImpl250.bpl">IP Abstraction Indy Implementation Design Time</Excluded_Packages> | ||||
|                     <Excluded_Packages Name="$(BDSBIN)\dcloffice2k250.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages> | ||||
|                     <Excluded_Packages Name="$(BDSBIN)\dclofficexp250.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages> | ||||
|                 </Excluded_Packages> | ||||
|             </Delphi.Personality> | ||||
|             <Deployment Version="3"> | ||||
|                 <DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule"> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <Overwrite>true</Overwrite> | ||||
|                     </Platform> | ||||
|                 </DeployFile> | ||||
|                 <DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule"> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Overwrite>true</Overwrite> | ||||
|                     </Platform> | ||||
|                 </DeployFile> | ||||
|                 <DeployFile LocalName="$(BDS)\Redist\iossimulator\libPCRE.dylib" Class="DependencyModule"> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Overwrite>true</Overwrite> | ||||
|                     </Platform> | ||||
|                 </DeployFile> | ||||
|                 <DeployFile LocalName="$(BDS)\Redist\osx32\libcgsqlite3.dylib" Class="DependencyModule"> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <Overwrite>true</Overwrite> | ||||
|                     </Platform> | ||||
|                 </DeployFile> | ||||
|                 <DeployFile LocalName="Win32\Debug\SimpleFMXBrowser.exe" Configuration="Debug" Class="ProjectOutput"> | ||||
|                     <Platform Name="Win32"> | ||||
|                         <RemoteName>SimpleFMXBrowser.exe</RemoteName> | ||||
|                         <Overwrite>true</Overwrite> | ||||
|                     </Platform> | ||||
|                 </DeployFile> | ||||
|                 <DeployClass Name="AdditionalDebugSymbols"> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <RemoteDir>Contents\MacOS</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="Win32"> | ||||
|                         <RemoteDir>Contents\MacOS</RemoteDir> | ||||
|                         <Operation>0</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="AndroidClassesDexFile"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>classes</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="AndroidGDBServer"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>library\lib\armeabi-v7a</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="AndroidLibnativeArmeabiFile"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>library\lib\armeabi</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="AndroidLibnativeMipsFile"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>library\lib\mips</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="AndroidServiceOutput"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>library\lib\armeabi-v7a</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="AndroidSplashImageDef"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\drawable</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="AndroidSplashStyles"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\values</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="Android_DefaultAppIcon"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\drawable</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="Android_LauncherIcon144"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\drawable-xxhdpi</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="Android_LauncherIcon36"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\drawable-ldpi</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="Android_LauncherIcon48"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\drawable-mdpi</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="Android_LauncherIcon72"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\drawable-hdpi</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="Android_LauncherIcon96"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\drawable-xhdpi</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="Android_SplashImage426"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\drawable-small</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="Android_SplashImage470"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\drawable-normal</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="Android_SplashImage640"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\drawable-large</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="Android_SplashImage960"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>res\drawable-xlarge</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="DebugSymbols"> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <RemoteDir>Contents\MacOS</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="Win32"> | ||||
|                         <Operation>0</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="DependencyFramework"> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <RemoteDir>Contents\MacOS</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                         <Extensions>.framework</Extensions> | ||||
|                     </Platform> | ||||
|                     <Platform Name="Win32"> | ||||
|                         <Operation>0</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="DependencyModule"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                         <Extensions>.dylib</Extensions> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                         <Extensions>.dylib</Extensions> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                         <Extensions>.dylib</Extensions> | ||||
|                     </Platform> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <RemoteDir>Contents\MacOS</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                         <Extensions>.dylib</Extensions> | ||||
|                     </Platform> | ||||
|                     <Platform Name="Win32"> | ||||
|                         <Operation>0</Operation> | ||||
|                         <Extensions>.dll;.bpl</Extensions> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Required="true" Name="DependencyPackage"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                         <Extensions>.dylib</Extensions> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                         <Extensions>.dylib</Extensions> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                         <Extensions>.dylib</Extensions> | ||||
|                     </Platform> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <RemoteDir>Contents\MacOS</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                         <Extensions>.dylib</Extensions> | ||||
|                     </Platform> | ||||
|                     <Platform Name="Win32"> | ||||
|                         <Operation>0</Operation> | ||||
|                         <Extensions>.bpl</Extensions> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="File"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <Operation>0</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>0</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>0</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>0</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <RemoteDir>Contents\Resources\StartUp\</RemoteDir> | ||||
|                         <Operation>0</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="Win32"> | ||||
|                         <Operation>0</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="iPad_Launch1024"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="iPad_Launch1536"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="iPad_Launch2048"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="iPad_Launch768"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="iPhone_Launch320"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="iPhone_Launch640"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="iPhone_Launch640x1136"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="ProjectAndroidManifest"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="ProjectiOSDeviceDebug"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="ProjectiOSDeviceResourceRules"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="ProjectiOSEntitlements"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <RemoteDir>..\</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <RemoteDir>..\</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="ProjectiOSInfoPList"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="ProjectiOSResource"> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="ProjectOSXEntitlements"> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <RemoteDir>..\</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="ProjectOSXInfoPList"> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <RemoteDir>Contents</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="ProjectOSXResource"> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <RemoteDir>Contents\Resources</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Required="true" Name="ProjectOutput"> | ||||
|                     <Platform Name="Android"> | ||||
|                         <RemoteDir>library\lib\armeabi-v7a</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSDevice64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="iOSSimulator"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="Linux64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="OSX32"> | ||||
|                         <RemoteDir>Contents\MacOS</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="Win32"> | ||||
|                         <Operation>0</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="ProjectUWPManifest"> | ||||
|                     <Platform Name="Win32"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="Win64"> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="UWP_DelphiLogo150"> | ||||
|                     <Platform Name="Win32"> | ||||
|                         <RemoteDir>Assets</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="Win64"> | ||||
|                         <RemoteDir>Assets</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <DeployClass Name="UWP_DelphiLogo44"> | ||||
|                     <Platform Name="Win32"> | ||||
|                         <RemoteDir>Assets</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                     <Platform Name="Win64"> | ||||
|                         <RemoteDir>Assets</RemoteDir> | ||||
|                         <Operation>1</Operation> | ||||
|                     </Platform> | ||||
|                 </DeployClass> | ||||
|                 <ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/> | ||||
|                 <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/> | ||||
|                 <ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/> | ||||
|                 <ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/> | ||||
|                 <ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/> | ||||
|                 <ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/> | ||||
|                 <ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/> | ||||
|                 <ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/> | ||||
|             </Deployment> | ||||
|             <Platforms> | ||||
|                 <Platform value="Win32">True</Platform> | ||||
|                 <Platform value="Win64">True</Platform> | ||||
|             </Platforms> | ||||
|         </BorlandProject> | ||||
|         <ProjectFileVersion>12</ProjectFileVersion> | ||||
|     </ProjectExtensions> | ||||
|     <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/> | ||||
|     <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/> | ||||
|     <Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/> | ||||
| </Project> | ||||
							
								
								
									
										384
									
								
								demos/SimpleFMXBrowser/cef.inc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										384
									
								
								demos/SimpleFMXBrowser/cef.inc
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,384 @@ | ||||
| // ************************************************************************ | ||||
| // ***************************** CEF4Delphi ******************************* | ||||
| // ************************************************************************ | ||||
| // | ||||
| // CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based | ||||
| // browser in Delphi applications. | ||||
| // | ||||
| // The original license of DCEF3 still applies to CEF4Delphi. | ||||
| // | ||||
| // For more information about CEF4Delphi visit : | ||||
| //         https://www.briskbard.com/index.php?lang=en&pageid=cef | ||||
| // | ||||
| //        Copyright � 2017 Salvador D�az Fau. All rights reserved. | ||||
| // | ||||
| // ************************************************************************ | ||||
| // ************ vvvv Original license and comments below vvvv ************* | ||||
| // ************************************************************************ | ||||
| (* | ||||
|  *                       Delphi Chromium Embedded 3 | ||||
|  * | ||||
|  * Usage allowed under the restrictions of the Lesser GNU General Public License | ||||
|  * or alternatively the restrictions of the Mozilla Public License 1.1 | ||||
|  * | ||||
|  * Software distributed under the License is distributed on an "AS IS" basis, | ||||
|  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for | ||||
|  * the specific language governing rights and limitations under the License. | ||||
|  * | ||||
|  * Unit owner : Henri Gourvest <hgourvest@gmail.com> | ||||
|  * Web site   : http://www.progdigy.com | ||||
|  * Repository : http://code.google.com/p/delphichromiumembedded/ | ||||
|  * Group      : http://groups.google.com/group/delphichromiumembedded | ||||
|  * | ||||
|  * Embarcadero Technologies, Inc is not permitted to use or redistribute | ||||
|  * this source code without explicit permission. | ||||
|  * | ||||
|  *) | ||||
|  | ||||
|  // The complete list of compiler versions is here : | ||||
|  // http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Compiler_Versions | ||||
|  | ||||
| {$DEFINE DELPHI_VERSION_UNKNOW} | ||||
|  | ||||
| {$IFDEF FPC} | ||||
|   {$DEFINE CEF_MULTI_THREADED_MESSAGE_LOOP} | ||||
|   {$DEFINE SUPPORTS_INLINE} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi 5 | ||||
| {$IFDEF VER130} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi 6 | ||||
| {$IFDEF VER140} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi 7 | ||||
| {$IFDEF VER150} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi 8 | ||||
| {$IFDEF VER160} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi 2005 | ||||
| {$IFDEF VER170} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| {$IFDEF VER180} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   // Delphi 2007 | ||||
|   {$IFDEF VER185} | ||||
|     {$DEFINE DELPHI5_UP} | ||||
|     {$DEFINE DELPHI6_UP} | ||||
|     {$DEFINE DELPHI7_UP} | ||||
|     {$DEFINE DELPHI8_UP} | ||||
|     {$DEFINE DELPHI9_UP} | ||||
|     {$DEFINE DELPHI10_UP} | ||||
|     {$DEFINE DELPHI11_UP} | ||||
|   // Delphi 2006 | ||||
|   {$ELSE} | ||||
|     {$DEFINE DELPHI5_UP} | ||||
|     {$DEFINE DELPHI6_UP} | ||||
|     {$DEFINE DELPHI7_UP} | ||||
|     {$DEFINE DELPHI8_UP} | ||||
|     {$DEFINE DELPHI9_UP} | ||||
|     {$DEFINE DELPHI10_UP} | ||||
|   {$ENDIF} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi 2009 | ||||
| {$IFDEF VER200} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| //Delphi 2010 | ||||
| {$IFDEF VER210} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi XE | ||||
| {$IFDEF VER220} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi XE2 | ||||
| {$IFDEF VER230} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
|   {$DEFINE DELPHI16_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi XE3 | ||||
| {$IFDEF VER240} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
|   {$DEFINE DELPHI16_UP} | ||||
|   {$DEFINE DELPHI17_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi XE4 | ||||
| {$IFDEF VER250} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
|   {$DEFINE DELPHI16_UP} | ||||
|   {$DEFINE DELPHI17_UP} | ||||
|   {$DEFINE DELPHI18_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi XE5 | ||||
| {$IFDEF VER260} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
|   {$DEFINE DELPHI16_UP} | ||||
|   {$DEFINE DELPHI17_UP} | ||||
|   {$DEFINE DELPHI18_UP} | ||||
|   {$DEFINE DELPHI19_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi XE6 | ||||
| {$IFDEF VER270} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
|   {$DEFINE DELPHI16_UP} | ||||
|   {$DEFINE DELPHI17_UP} | ||||
|   {$DEFINE DELPHI18_UP} | ||||
|   {$DEFINE DELPHI19_UP} | ||||
|   {$DEFINE DELPHI20_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi XE7 | ||||
| {$IFDEF VER280} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
|   {$DEFINE DELPHI16_UP} | ||||
|   {$DEFINE DELPHI17_UP} | ||||
|   {$DEFINE DELPHI18_UP} | ||||
|   {$DEFINE DELPHI19_UP} | ||||
|   {$DEFINE DELPHI20_UP} | ||||
|   {$DEFINE DELPHI21_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Delphi XE8 | ||||
| {$IFDEF VER290} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
|   {$DEFINE DELPHI16_UP} | ||||
|   {$DEFINE DELPHI17_UP} | ||||
|   {$DEFINE DELPHI18_UP} | ||||
|   {$DEFINE DELPHI19_UP} | ||||
|   {$DEFINE DELPHI20_UP} | ||||
|   {$DEFINE DELPHI21_UP} | ||||
|   {$DEFINE DELPHI22_UP} | ||||
| {$ENDIF VER290} | ||||
|  | ||||
| // Rad Studio 10 - Delphi Seattle | ||||
| {$IFDEF VER300} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
|   {$DEFINE DELPHI16_UP} | ||||
|   {$DEFINE DELPHI17_UP} | ||||
|   {$DEFINE DELPHI18_UP} | ||||
|   {$DEFINE DELPHI19_UP} | ||||
|   {$DEFINE DELPHI20_UP} | ||||
|   {$DEFINE DELPHI21_UP} | ||||
|   {$DEFINE DELPHI22_UP} | ||||
|   {$DEFINE DELPHI23_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Rad Studio 10.1 - Delphi Berlin | ||||
| {$IFDEF VER310} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
|   {$DEFINE DELPHI16_UP} | ||||
|   {$DEFINE DELPHI17_UP} | ||||
|   {$DEFINE DELPHI18_UP} | ||||
|   {$DEFINE DELPHI19_UP} | ||||
|   {$DEFINE DELPHI20_UP} | ||||
|   {$DEFINE DELPHI21_UP} | ||||
|   {$DEFINE DELPHI22_UP} | ||||
|   {$DEFINE DELPHI23_UP} | ||||
|   {$DEFINE DELPHI24_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| // Rad Studio 10.2 - Delphi Tokyo | ||||
| {$IFDEF VER320} | ||||
|   {$UNDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
|   {$DEFINE DELPHI16_UP} | ||||
|   {$DEFINE DELPHI17_UP} | ||||
|   {$DEFINE DELPHI18_UP} | ||||
|   {$DEFINE DELPHI19_UP} | ||||
|   {$DEFINE DELPHI20_UP} | ||||
|   {$DEFINE DELPHI21_UP} | ||||
|   {$DEFINE DELPHI22_UP} | ||||
|   {$DEFINE DELPHI23_UP} | ||||
|   {$DEFINE DELPHI24_UP} | ||||
|   {$DEFINE DELPHI25_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
|  | ||||
| {$IFDEF DELPHI_VERSION_UNKNOW} | ||||
|   {$DEFINE DELPHI5_UP} | ||||
|   {$DEFINE DELPHI6_UP} | ||||
|   {$DEFINE DELPHI7_UP} | ||||
|   {$DEFINE DELPHI8_UP} | ||||
|   {$DEFINE DELPHI9_UP} | ||||
|   {$DEFINE DELPHI10_UP} | ||||
|   {$DEFINE DELPHI11_UP} | ||||
|   {$DEFINE DELPHI12_UP} | ||||
|   {$DEFINE DELPHI14_UP} | ||||
|   {$DEFINE DELPHI15_UP} | ||||
|   {$DEFINE DELPHI16_UP} | ||||
|   {$DEFINE DELPHI17_UP} | ||||
|   {$DEFINE DELPHI18_UP} | ||||
|   {$DEFINE DELPHI19_UP} | ||||
|   {$DEFINE DELPHI20_UP} | ||||
|   {$DEFINE DELPHI21_UP} | ||||
|   {$DEFINE DELPHI22_UP} | ||||
|   {$DEFINE DELPHI23_UP} | ||||
|   {$DEFINE DELPHI24_UP} | ||||
|   {$DEFINE DELPHI25_UP} | ||||
| {$ENDIF} | ||||
|  | ||||
| {$IFDEF DELPHI9_UP} | ||||
|   {$DEFINE SUPPORTS_INLINE} | ||||
| {$ENDIF} | ||||
|  | ||||
							
								
								
									
										192
									
								
								demos/SimpleFMXBrowser/uFMXApplicationService.pas
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										192
									
								
								demos/SimpleFMXBrowser/uFMXApplicationService.pas
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,192 @@ | ||||
| // ************************************************************************ | ||||
| // ***************************** CEF4Delphi ******************************* | ||||
| // ************************************************************************ | ||||
| // | ||||
| // CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based | ||||
| // browser in Delphi applications. | ||||
| // | ||||
| // The original license of DCEF3 still applies to CEF4Delphi. | ||||
| // | ||||
| // For more information about CEF4Delphi visit : | ||||
| //         https://www.briskbard.com/index.php?lang=en&pageid=cef | ||||
| // | ||||
| //        Copyright � 2018 Salvador D�az Fau. All rights reserved. | ||||
| // | ||||
| // ************************************************************************ | ||||
| // ************ vvvv Original license and comments below vvvv ************* | ||||
| // ************************************************************************ | ||||
| (* | ||||
|  *                       Delphi Chromium Embedded 3 | ||||
|  * | ||||
|  * Usage allowed under the restrictions of the Lesser GNU General Public License | ||||
|  * or alternatively the restrictions of the Mozilla Public License 1.1 | ||||
|  * | ||||
|  * Software distributed under the License is distributed on an "AS IS" basis, | ||||
|  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for | ||||
|  * the specific language governing rights and limitations under the License. | ||||
|  * | ||||
|  * Unit owner : Henri Gourvest <hgourvest@gmail.com> | ||||
|  * Web site   : http://www.progdigy.com | ||||
|  * Repository : http://code.google.com/p/delphichromiumembedded/ | ||||
|  * Group      : http://groups.google.com/group/delphichromiumembedded | ||||
|  * | ||||
|  * Embarcadero Technologies, Inc is not permitted to use or redistribute | ||||
|  * this source code without explicit permission. | ||||
|  * | ||||
|  *) | ||||
|  | ||||
| unit uFMXApplicationService; | ||||
|  | ||||
| {$I cef.inc} | ||||
|  | ||||
| // This unit is based in the TFMXApplicationService class created by Takashi Yamamoto | ||||
| // https://www.gesource.jp/weblog/?p=7367 | ||||
|  | ||||
| interface | ||||
|  | ||||
| uses | ||||
|   FMX.Platform; | ||||
|  | ||||
| type | ||||
|   TFMXApplicationService = class(TInterfacedObject, IFMXApplicationService) | ||||
|     protected | ||||
|       class var OldFMXApplicationService: IFMXApplicationService; | ||||
|       class var NewFMXApplicationService: IFMXApplicationService; | ||||
|  | ||||
|     public | ||||
|       procedure Run; | ||||
|       function  HandleMessage: Boolean; | ||||
|       procedure WaitMessage; | ||||
|       function  GetDefaultTitle: string; | ||||
|       function  GetTitle: string; | ||||
|       procedure SetTitle(const Value: string); | ||||
|       function  GetVersionString: string; | ||||
|       procedure Terminate; | ||||
|       function  Terminating: Boolean; | ||||
|       function  Running: Boolean; | ||||
|  | ||||
|       class procedure AddPlatformService; | ||||
|  | ||||
|       property  DefaultTitle  : string read GetDefaultTitle; | ||||
|       property  Title         : string read GetTitle          write SetTitle; | ||||
|       property  AppVersion    : string read GetVersionString; | ||||
|   end; | ||||
|  | ||||
| implementation | ||||
|  | ||||
| uses | ||||
|   FMX.Forms, | ||||
|   uSimpleFMXBrowser, | ||||
|   uFMXWorkScheduler, | ||||
|   uCEFApplication, | ||||
|   {$IFDEF MSWINDOWS} | ||||
|   Winapi.Messages, Winapi.Windows, | ||||
|   {$ENDIF} | ||||
|   uCEFConstants; | ||||
|  | ||||
| class procedure TFMXApplicationService.AddPlatformService; | ||||
| begin | ||||
|   if TPlatformServices.Current.SupportsPlatformService(IFMXApplicationService, IInterface(OldFMXApplicationService)) then | ||||
|     begin | ||||
|       TPlatformServices.Current.RemovePlatformService(IFMXApplicationService); | ||||
|  | ||||
|       NewFMXApplicationService := TFMXApplicationService.Create; | ||||
|       TPlatformServices.Current.AddPlatformService(IFMXApplicationService, NewFMXApplicationService); | ||||
|     end; | ||||
| end; | ||||
|  | ||||
| function TFMXApplicationService.GetDefaultTitle: string; | ||||
| begin | ||||
|   Result := OldFMXApplicationService.GetDefaultTitle; | ||||
| end; | ||||
|  | ||||
| function TFMXApplicationService.GetTitle: string; | ||||
| begin | ||||
|   Result := OldFMXApplicationService.GetTitle; | ||||
| end; | ||||
|  | ||||
| function TFMXApplicationService.GetVersionString: string; | ||||
| begin | ||||
|   Result := OldFMXApplicationService.GetVersionString; | ||||
| end; | ||||
|  | ||||
| procedure TFMXApplicationService.Run; | ||||
| begin | ||||
|   OldFMXApplicationService.Run; | ||||
| end; | ||||
|  | ||||
| procedure TFMXApplicationService.SetTitle(const Value: string); | ||||
| begin | ||||
|   OldFMXApplicationService.SetTitle(Value); | ||||
| end; | ||||
|  | ||||
| procedure TFMXApplicationService.Terminate; | ||||
| begin | ||||
|   OldFMXApplicationService.Terminate; | ||||
| end; | ||||
|  | ||||
| function TFMXApplicationService.Terminating: Boolean; | ||||
| begin | ||||
|   Result := OldFMXApplicationService.Terminating; | ||||
| end; | ||||
|  | ||||
| procedure TFMXApplicationService.WaitMessage; | ||||
| begin | ||||
|   OldFMXApplicationService.WaitMessage; | ||||
| end; | ||||
|  | ||||
| function TFMXApplicationService.Running: Boolean; | ||||
| begin | ||||
|   {$IFDEF DELPHI24_UP} | ||||
|   Result := OldFMXApplicationService.Running; | ||||
|   {$ELSE} | ||||
|   Result := True; | ||||
|   {$ENDIF} | ||||
| end; | ||||
|  | ||||
| function TFMXApplicationService.HandleMessage: Boolean; | ||||
| {$IFDEF MSWINDOWS} | ||||
| var | ||||
|   TempMsg : TMsg; | ||||
| {$ENDIF} | ||||
| begin | ||||
|   {$IFDEF MSWINDOWS} | ||||
|   if PeekMessage(TempMsg, 0, 0, 0, PM_NOREMOVE) then | ||||
|     case TempMsg.Message of | ||||
|       WM_MOVE, | ||||
|       WM_MOVING : | ||||
|         if not(Application.Terminated) and | ||||
|            (Application.MainForm <> nil) and | ||||
|            (Application.MainForm is TSimpleFMXBrowserFrm) then | ||||
|           TSimpleFMXBrowserFrm(Application.MainForm).NotifyMoveOrResizeStarted; | ||||
|  | ||||
|       WM_ENTERMENULOOP : | ||||
|         if not(Application.Terminated) and | ||||
|            (TempMsg.wParam = 0) and | ||||
|            (GlobalCEFApp <> nil) then | ||||
|           GlobalCEFApp.OsmodalLoop := True; | ||||
|  | ||||
|       WM_EXITMENULOOP : | ||||
|         if not(Application.Terminated) and | ||||
|            (TempMsg.wParam = 0) and | ||||
|            (GlobalCEFApp <> nil) then | ||||
|           GlobalCEFApp.OsmodalLoop := False; | ||||
|  | ||||
|       CEF_AFTERCREATED : | ||||
|         if not(Application.Terminated) and | ||||
|            (Application.MainForm <> nil) and | ||||
|            (Application.MainForm is TSimpleFMXBrowserFrm) then | ||||
|           TSimpleFMXBrowserFrm(Application.MainForm).DoBrowserCreated; | ||||
|  | ||||
|       CEF_DESTROY : | ||||
|         if not(Application.Terminated) and | ||||
|            (Application.MainForm <> nil) and | ||||
|            (Application.MainForm is TSimpleFMXBrowserFrm) then | ||||
|           TSimpleFMXBrowserFrm(Application.MainForm).DoDestroyParent; | ||||
|     end; | ||||
|   {$ENDIF} | ||||
|  | ||||
|   Result := OldFMXApplicationService.HandleMessage; | ||||
| end; | ||||
|  | ||||
| end. | ||||
							
								
								
									
										63
									
								
								demos/SimpleFMXBrowser/uSimpleFMXBrowser.fmx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								demos/SimpleFMXBrowser/uSimpleFMXBrowser.fmx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,63 @@ | ||||
| object SimpleFMXBrowserFrm: TSimpleFMXBrowserFrm | ||||
|   Left = 0 | ||||
|   Top = 0 | ||||
|   Caption = 'Initializing, Please wait...' | ||||
|   ClientHeight = 600 | ||||
|   ClientWidth = 917 | ||||
|   Position = ScreenCenter | ||||
|   FormFactor.Width = 320 | ||||
|   FormFactor.Height = 480 | ||||
|   FormFactor.Devices = [Desktop] | ||||
|   OnCreate = FormCreate | ||||
|   OnCloseQuery = FormCloseQuery | ||||
|   OnResize = FormResize | ||||
|   OnShow = FormShow | ||||
|   DesignerMasterStyle = 0 | ||||
|   object AddressPnl: TPanel | ||||
|     Align = Top | ||||
|     Enabled = False | ||||
|     Padding.Left = 5.000000000000000000 | ||||
|     Padding.Top = 5.000000000000000000 | ||||
|     Padding.Right = 5.000000000000000000 | ||||
|     Padding.Bottom = 5.000000000000000000 | ||||
|     Size.Width = 917.000000000000000000 | ||||
|     Size.Height = 35.000000000000000000 | ||||
|     Size.PlatformDefault = False | ||||
|     TabOrder = 1 | ||||
|     object AddressEdt: TEdit | ||||
|       Touch.InteractiveGestures = [LongTap, DoubleTap] | ||||
|       Align = Client | ||||
|       TabOrder = 1 | ||||
|       Text = 'https://www.google.com' | ||||
|       Size.Width = 871.000000000000000000 | ||||
|       Size.Height = 25.000000000000000000 | ||||
|       Size.PlatformDefault = False | ||||
|     end | ||||
|     object GoBtn: TButton | ||||
|       Align = Right | ||||
|       Position.X = 876.000000000000000000 | ||||
|       Position.Y = 5.000000000000000000 | ||||
|       Size.Width = 36.000000000000000000 | ||||
|       Size.Height = 25.000000000000000000 | ||||
|       Size.PlatformDefault = False | ||||
|       TabOrder = 0 | ||||
|       Text = 'Go' | ||||
|       OnClick = GoBtnClick | ||||
|     end | ||||
|   end | ||||
|   object Timer1: TTimer | ||||
|     Enabled = False | ||||
|     Interval = 300 | ||||
|     OnTimer = Timer1Timer | ||||
|     Left = 40 | ||||
|     Top = 129 | ||||
|   end | ||||
|   object FMXChromium1: TFMXChromium | ||||
|     OnBeforePopup = FMXChromium1BeforePopup | ||||
|     OnAfterCreated = FMXChromium1AfterCreated | ||||
|     OnBeforeClose = FMXChromium1BeforeClose | ||||
|     OnClose = FMXChromium1Close | ||||
|     Left = 40 | ||||
|     Top = 65 | ||||
|   end | ||||
| end | ||||
							
								
								
									
										309
									
								
								demos/SimpleFMXBrowser/uSimpleFMXBrowser.pas
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										309
									
								
								demos/SimpleFMXBrowser/uSimpleFMXBrowser.pas
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,309 @@ | ||||
| // ************************************************************************ | ||||
| // ***************************** CEF4Delphi ******************************* | ||||
| // ************************************************************************ | ||||
| // | ||||
| // CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based | ||||
| // browser in Delphi applications. | ||||
| // | ||||
| // The original license of DCEF3 still applies to CEF4Delphi. | ||||
| // | ||||
| // For more information about CEF4Delphi visit : | ||||
| //         https://www.briskbard.com/index.php?lang=en&pageid=cef | ||||
| // | ||||
| //        Copyright � 2018 Salvador D�az Fau. All rights reserved. | ||||
| // | ||||
| // ************************************************************************ | ||||
| // ************ vvvv Original license and comments below vvvv ************* | ||||
| // ************************************************************************ | ||||
| (* | ||||
|  *                       Delphi Chromium Embedded 3 | ||||
|  * | ||||
|  * Usage allowed under the restrictions of the Lesser GNU General Public License | ||||
|  * or alternatively the restrictions of the Mozilla Public License 1.1 | ||||
|  * | ||||
|  * Software distributed under the License is distributed on an "AS IS" basis, | ||||
|  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for | ||||
|  * the specific language governing rights and limitations under the License. | ||||
|  * | ||||
|  * Unit owner : Henri Gourvest <hgourvest@gmail.com> | ||||
|  * Web site   : http://www.progdigy.com | ||||
|  * Repository : http://code.google.com/p/delphichromiumembedded/ | ||||
|  * Group      : http://groups.google.com/group/delphichromiumembedded | ||||
|  * | ||||
|  * Embarcadero Technologies, Inc is not permitted to use or redistribute | ||||
|  * this source code without explicit permission. | ||||
|  * | ||||
|  *) | ||||
|  | ||||
| unit uSimpleFMXBrowser; | ||||
|  | ||||
| {$I cef.inc} | ||||
|  | ||||
| interface | ||||
|  | ||||
| uses | ||||
|   {$IFDEF MSWINDOWS} | ||||
|   Winapi.Messages, Winapi.Windows, | ||||
|   {$ENDIF} | ||||
|   System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, | ||||
|   FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, | ||||
|   FMX.Edit, FMX.Controls.Presentation, uFMXWindowParent, uFMXChromium, | ||||
|   uCEFInterfaces, uCEFConstants, uCEFTypes; | ||||
|  | ||||
| type | ||||
|   TSimpleFMXBrowserFrm = class(TForm) | ||||
|     AddressPnl: TPanel; | ||||
|     AddressEdt: TEdit; | ||||
|     GoBtn: TButton; | ||||
|     FMXChromium1: TFMXChromium; | ||||
|     Timer1: TTimer; | ||||
|     procedure GoBtnClick(Sender: TObject); | ||||
|     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); | ||||
|     procedure FormCreate(Sender: TObject); | ||||
|     procedure Timer1Timer(Sender: TObject); | ||||
|     procedure FormShow(Sender: TObject); | ||||
|     procedure FMXChromium1AfterCreated(Sender: TObject; | ||||
|       const browser: ICefBrowser); | ||||
|     procedure FMXChromium1Close(Sender: TObject; | ||||
|       const browser: ICefBrowser; out Result: Boolean); | ||||
|     procedure FMXChromium1BeforeClose(Sender: TObject; | ||||
|       const browser: ICefBrowser); | ||||
|     procedure FMXChromium1BeforePopup(Sender: TObject; | ||||
|       const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, | ||||
|       targetFrameName: ustring; | ||||
|       targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; | ||||
|       const popupFeatures: TCefPopupFeatures; | ||||
|       var windowInfo: TCefWindowInfo; var client: ICefClient; | ||||
|       var settings: TCefBrowserSettings; var noJavascriptAccess, | ||||
|       Result: Boolean); | ||||
|     procedure FormResize(Sender: TObject); | ||||
|  | ||||
|   protected | ||||
|     // Variables to control when can we destroy the form safely | ||||
|     FCanClose : boolean;  // Set to True in TFMXChromium.OnBeforeClose | ||||
|     FClosing  : boolean;  // Set to True in the CloseQuery event. | ||||
|  | ||||
|     FMXWindowParent : TFMXWindowParent; | ||||
|  | ||||
|     procedure LoadURL; | ||||
|     procedure ResizeChild; | ||||
|     procedure CreateFMXWindowParent; | ||||
|     function  PostCustomMessage(aMessage : cardinal; wParam : cardinal = 0; lParam : integer = 0) : boolean; | ||||
|  | ||||
|   public | ||||
|     procedure DoBrowserCreated; | ||||
|     procedure DoDestroyParent; | ||||
|     procedure NotifyMoveOrResizeStarted; | ||||
|   end; | ||||
|  | ||||
| var | ||||
|   SimpleFMXBrowserFrm: TSimpleFMXBrowserFrm; | ||||
|  | ||||
| implementation | ||||
|  | ||||
| {$R *.fmx} | ||||
|  | ||||
| // This is a demo with the simplest web browser you can build using CEF4Delphi | ||||
| // with FMX components and it doesn't show any sign of progress like other web browsers do. | ||||
|  | ||||
| // Remember that it may take a few seconds to load if Windows update, your antivirus or | ||||
| // any other windows service is using your hard drive. | ||||
|  | ||||
| // Depending on your internet connection it may take longer than expected. | ||||
|  | ||||
| // Please check that your firewall or antivirus are not blocking this application | ||||
| // or the domain "google.com". If you don't live in the US, you'll be redirected to | ||||
| // another domain which will take a little time too. | ||||
|  | ||||
| // This demo uses a TFMXChromium and a TFMXWindowParent. | ||||
| // TFMXApplicationService is used to handle custom Windows messages | ||||
|  | ||||
| // Destruction steps | ||||
| // ================= | ||||
| // 1. FormCloseQuery sets CanClose to FALSE calls TFMXChromium.CloseBrowser which triggers the TFMXChromium.OnClose event. | ||||
| // 2. TFMXChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TFMXChromium.OnBeforeClose event. | ||||
| // 3. TFMXChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form. | ||||
|  | ||||
| uses | ||||
|   FMX.Platform, FMX.Platform.Win, | ||||
|   uCEFMiscFunctions, uCEFApplication, uFMXApplicationService; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.FMXChromium1AfterCreated(Sender: TObject; const browser: ICefBrowser); | ||||
| begin | ||||
|   // Now the browser is fully initialized we can send a message to the main form to load the initial web page. | ||||
|   PostCustomMessage(CEF_AFTERCREATED); | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.FMXChromium1BeforeClose(Sender: TObject; const browser: ICefBrowser); | ||||
| begin | ||||
|   FCanClose := True; | ||||
|   PostCustomMessage(WM_CLOSE); | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.FMXChromium1BeforePopup(      Sender             : TObject; | ||||
|                                                        const browser            : ICefBrowser; | ||||
|                                                        const frame              : ICefFrame; | ||||
|                                                        const targetUrl          : ustring; | ||||
|                                                        const targetFrameName    : ustring; | ||||
|                                                              targetDisposition  : TCefWindowOpenDisposition; | ||||
|                                                              userGesture        : Boolean; | ||||
|                                                        const popupFeatures      : TCefPopupFeatures; | ||||
|                                                        var   windowInfo         : TCefWindowInfo; | ||||
|                                                        var   client             : ICefClient; | ||||
|                                                        var   settings           : TCefBrowserSettings; | ||||
|                                                        var   noJavascriptAccess : boolean; | ||||
|                                                        var   Result             : boolean); | ||||
| begin | ||||
|   // For simplicity, this demo blocks all popup windows and new tabs | ||||
|   Result := (targetDisposition in [WOD_NEW_FOREGROUND_TAB, WOD_NEW_BACKGROUND_TAB, WOD_NEW_POPUP, WOD_NEW_WINDOW]); | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.FMXChromium1Close(Sender: TObject; const browser: ICefBrowser; out Result: Boolean); | ||||
| begin | ||||
|   PostCustomMessage(CEF_DESTROY); | ||||
|   Result := True; | ||||
| end; | ||||
|  | ||||
| function TSimpleFMXBrowserFrm.PostCustomMessage(aMessage, wParam : cardinal; lParam : integer) : boolean; | ||||
| {$IFDEF MSWINDOWS} | ||||
| var | ||||
|   TempHWND : HWND; | ||||
| {$ENDIF} | ||||
| begin | ||||
|   {$IFDEF MSWINDOWS} | ||||
|   TempHWND := FmxHandleToHWND(Handle); | ||||
|   Result   := (TempHWND <> 0) and WinApi.Windows.PostMessage(TempHWND, aMessage, wParam, lParam); | ||||
|   {$ELSE} | ||||
|   Result   := False; | ||||
|   {$ENDIF} | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean); | ||||
| begin | ||||
|   CanClose := FCanClose; | ||||
|  | ||||
|   if not(FClosing) then | ||||
|     begin | ||||
|       FClosing := True; | ||||
|       Visible  := False; | ||||
|       FMXChromium1.CloseBrowser(True); | ||||
|     end; | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.FormCreate(Sender: TObject); | ||||
| begin | ||||
|   // TFMXApplicationService is used to handle custom Windows messages | ||||
|   TFMXApplicationService.AddPlatformService; | ||||
|  | ||||
|   FCanClose       := False; | ||||
|   FClosing        := False; | ||||
|   FMXWindowParent := nil; | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.FormResize(Sender: TObject); | ||||
| begin | ||||
|   // TFMXWindowParent has to be resized at runtime | ||||
|   ResizeChild; | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.ResizeChild; | ||||
| var | ||||
|   TempRect : System.Types.TRect; | ||||
| begin | ||||
|   if (FMXWindowParent <> nil) then | ||||
|     begin | ||||
|       TempRect.Top    := round(AddressPnl.Height); | ||||
|       TempRect.Left   := 0; | ||||
|       TempRect.Right  := ClientWidth  - 1; | ||||
|       TempRect.Bottom := ClientHeight - 1; | ||||
|  | ||||
|       FMXWindowParent.SetBounds(TempRect); | ||||
|     end; | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.CreateFMXWindowParent; | ||||
| begin | ||||
|   if (FMXWindowParent = nil) then | ||||
|     begin | ||||
|       FMXWindowParent := TFMXWindowParent.CreateNew(nil); | ||||
|       FMXWindowParent.Reparent(Handle); | ||||
|       ResizeChild; | ||||
|       FMXWindowParent.Show; | ||||
|     end; | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.FormShow(Sender: TObject); | ||||
| var | ||||
|   TempHandle : HWND; | ||||
|   TempRect   : System.Types.TRect; | ||||
|   TempClientRect : TRectF; | ||||
| begin | ||||
|   // TFMXWindowParent has to be created at runtime | ||||
|   CreateFMXWindowParent; | ||||
|  | ||||
|   // You *MUST* call CreateBrowser to create and initialize the browser. | ||||
|   // This will trigger the AfterCreated event when the browser is fully | ||||
|   // initialized and ready to receive commands. | ||||
|  | ||||
|   // GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser | ||||
|   // If it's not initialized yet, we use a simple timer to create the browser later. | ||||
|   if not(FMXChromium1.Initialized) then | ||||
|     begin | ||||
|       TempHandle      := FmxHandleToHWND(FMXWindowParent.Handle); | ||||
|       TempClientRect  := FMXWindowParent.ClientRect; | ||||
|       TempRect.Left   := round(TempClientRect.Left); | ||||
|       TempRect.Top    := round(TempClientRect.Top); | ||||
|       TempRect.Right  := round(TempClientRect.Right); | ||||
|       TempRect.Bottom := round(TempClientRect.Bottom); | ||||
|  | ||||
|       if not(FMXChromium1.CreateBrowser(TempHandle, TempRect)) then Timer1.Enabled := True; | ||||
|     end; | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.GoBtnClick(Sender: TObject); | ||||
| begin | ||||
|   LoadURL; | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.NotifyMoveOrResizeStarted; | ||||
| begin | ||||
|   if (FMXChromium1 <> nil) then FMXChromium1.NotifyMoveOrResizeStarted; | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.Timer1Timer(Sender: TObject); | ||||
| var | ||||
|   TempHandle : HWND; | ||||
|   TempRect   : System.Types.TRect; | ||||
|   TempClientRect : TRectF; | ||||
| begin | ||||
|   Timer1.Enabled  := False; | ||||
|   TempHandle      := FmxHandleToHWND(FMXWindowParent.Handle); | ||||
|   TempClientRect  := FMXWindowParent.ClientRect; | ||||
|   TempRect.Left   := round(TempClientRect.Left); | ||||
|   TempRect.Top    := round(TempClientRect.Top); | ||||
|   TempRect.Right  := round(TempClientRect.Right); | ||||
|   TempRect.Bottom := round(TempClientRect.Bottom); | ||||
|  | ||||
|   if not(FMXChromium1.CreateBrowser(TempHandle, TempRect)) and not(FMXChromium1.Initialized) then | ||||
|     Timer1.Enabled := True; | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.DoBrowserCreated; | ||||
| begin | ||||
|   // Now the browser is fully initialized | ||||
|   Caption            := 'Simple FMX Browser'; | ||||
|   AddressPnl.Enabled := True; | ||||
|   LoadURL; | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.DoDestroyParent; | ||||
| begin | ||||
|   if (FMXWindowParent <> nil) then FMXWindowParent.Free; | ||||
| end; | ||||
|  | ||||
| procedure TSimpleFMXBrowserFrm.LoadURL; | ||||
| begin | ||||
|   FMXChromium1.LoadURL(AddressEdt.Text); | ||||
| end; | ||||
|  | ||||
| end. | ||||
| @@ -57,7 +57,7 @@ uses | ||||
| const | ||||
|   CEF_SUPPORTED_VERSION_MAJOR   = 3; | ||||
|   CEF_SUPPORTED_VERSION_MINOR   = 3325; | ||||
|   CEF_SUPPORTED_VERSION_RELEASE = 1756; | ||||
|   CEF_SUPPORTED_VERSION_RELEASE = 1758; | ||||
|   CEF_SUPPORTED_VERSION_BUILD   = 0; | ||||
|  | ||||
|   CEF_CHROMEELF_VERSION_MAJOR   = 65; | ||||
|   | ||||
| @@ -316,8 +316,8 @@ type | ||||
|       procedure DelayedDragging; | ||||
|       function  SendCompMessage(aMsg : cardinal; wParam : cardinal = 0; lParam : integer = 0) : boolean; | ||||
|       procedure ToMouseEvent(grfKeyState : Longint; pt : TPoint; var aMouseEvent : TCefMouseEvent); | ||||
|       procedure FreeAndNilStub(var aStub : pointer); | ||||
|  | ||||
|       procedure FreeAndNilStub(var aStub : pointer); | ||||
|       procedure CreateStub(const aMethod : TWndMethod; var aStub : Pointer); | ||||
|       procedure WndProc(var aMessage: TMessage); | ||||
|       procedure BrowserCompWndProc(var aMessage: TMessage); | ||||
| @@ -444,11 +444,11 @@ type | ||||
|       function    CreateClientHandler(aIsOSR : boolean) : boolean; overload; | ||||
|       function    CreateClientHandler(var aClient : ICefClient; aIsOSR : boolean = True) : boolean; overload; | ||||
|       procedure   CloseBrowser(aForceClose : boolean); | ||||
|       function    CreateBrowser(const aBrowserParent : TWinControl = nil; const aWindowName : string = ''; const aContext : ICefRequestContext = nil; const aCookiesPath : string = ''; aPersistSessionCookies : boolean = False) : boolean; overload; virtual; | ||||
|       function    CreateBrowser(aParentHandle : HWND; aParentRect : TRect; const aWindowName : string = ''; const aContext : ICefRequestContext = nil; const aCookiesPath : string = ''; aPersistSessionCookies : boolean = False) : boolean; overload; virtual; | ||||
|       function    ShareRequestContext(var aContext : ICefRequestContext; const aHandler : ICefRequestContextHandler = nil) : boolean; | ||||
|       procedure   InitializeDragAndDrop(const aDropTargetCtrl : TWinControl); | ||||
|       procedure   ShutdownDragAndDrop; | ||||
|       function    CreateBrowser(const aBrowserParent : TWinControl = nil; const aWindowName : string = ''; const aContext : ICefRequestContext = nil; const aCookiesPath : string = ''; aPersistSessionCookies : boolean = False) : boolean; overload; virtual; | ||||
|       function    CreateBrowser(aParentHandle : HWND; aParentRect : TRect; const aWindowName : string = ''; const aContext : ICefRequestContext = nil; const aCookiesPath : string = ''; aPersistSessionCookies : boolean = False) : boolean; overload; virtual; | ||||
|  | ||||
|       procedure   LoadURL(const aURL : ustring); | ||||
|       procedure   LoadString(const aString : ustring; const aURL : ustring = ''); | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -434,8 +434,11 @@ type | ||||
|       function    CreateClientHandler(aIsOSR : boolean = True) : boolean; overload; | ||||
|       function    CreateClientHandler(var aClient : ICefClient; aIsOSR : boolean = True) : boolean; overload; | ||||
|       procedure   CloseBrowser(aForceClose : boolean); | ||||
|       function    CreateBrowser(const aWindowName : string = ''; const aContext : ICefRequestContext = nil; const aCookiesPath : string = ''; aPersistSessionCookies : boolean = False) : boolean; virtual; | ||||
|       function    ShareRequestContext(var aContext : ICefRequestContext; const aHandler : ICefRequestContextHandler = nil) : boolean; | ||||
|       function    CreateBrowser(const aWindowName : string = ''; const aContext : ICefRequestContext = nil; const aCookiesPath : string = ''; aPersistSessionCookies : boolean = False) : boolean; overload; virtual; | ||||
|       {$IFDEF MSWINDOWS} | ||||
|       function    CreateBrowser(aParentHandle : HWND; aParentRect : TRect; const aWindowName : string = ''; const aContext : ICefRequestContext = nil; const aCookiesPath : string = ''; aPersistSessionCookies : boolean = False) : boolean; overload; virtual; | ||||
|       {$ENDIF} | ||||
|  | ||||
|       procedure   LoadURL(const aURL : ustring); | ||||
|       procedure   LoadString(const aString : ustring; const aURL : ustring = ''); | ||||
| @@ -1035,6 +1038,64 @@ begin | ||||
|   end; | ||||
| end; | ||||
|  | ||||
| {$IFDEF MSWINDOWS} | ||||
| function TFMXChromium.CreateBrowser(      aParentHandle          : HWND; | ||||
|                                           aParentRect            : TRect; | ||||
|                                     const aWindowName            : string; | ||||
|                                     const aContext               : ICefRequestContext; | ||||
|                                     const aCookiesPath           : string; | ||||
|                                           aPersistSessionCookies : boolean) : boolean; | ||||
| var | ||||
|   TempCookieManager : ICefCookieManager; | ||||
| begin | ||||
|   Result := False; | ||||
|  | ||||
|   try | ||||
|     // GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser | ||||
|     // even if you use a custom request context. | ||||
|     // If you create a browser in the initialization of your app, make sure you call this | ||||
|     // function when GlobalCEFApp.GlobalContextInitialized is TRUE. | ||||
|     // Use the GlobalCEFApp.OnContextInitialized event to know when | ||||
|     // GlobalCEFApp.GlobalContextInitialized is set to TRUE. | ||||
|  | ||||
|     if not(csDesigning in ComponentState) and | ||||
|        not(FClosing)         and | ||||
|        (FBrowser     =  nil) and | ||||
|        (FBrowserId   =  0)   and | ||||
|        (GlobalCEFApp <> nil) and | ||||
|        GlobalCEFApp.GlobalContextInitialized  and | ||||
|        CreateClientHandler(aParentHandle = 0) then | ||||
|       begin | ||||
|         GetSettings(FBrowserSettings); | ||||
|  | ||||
|         if FIsOSR then | ||||
|           WindowInfoAsWindowless(FWindowInfo, 0, aWindowName) | ||||
|          else | ||||
|           WindowInfoAsChild(FWindowInfo, aParentHandle, aParentRect, aWindowName); | ||||
|  | ||||
|  | ||||
|         if (aContext <> nil) and (length(aCookiesPath) > 0) then | ||||
|           begin | ||||
|             TempCookieManager := aContext.GetDefaultCookieManager(nil); | ||||
|  | ||||
|             if (TempCookieManager = nil) or | ||||
|                not(TempCookieManager.SetStoragePath(aCookiesPath, aPersistSessionCookies, nil)) then | ||||
|               OutputDebugMessage('TChromium.CreateBrowser error : cookies cannot be accessed'); | ||||
|           end; | ||||
|  | ||||
|  | ||||
|         if GlobalCEFApp.MultiThreadedMessageLoop then | ||||
|           Result := CreateBrowserHost(@FWindowInfo, FDefaultUrl, @FBrowserSettings, aContext) | ||||
|          else | ||||
|           Result := CreateBrowserHostSync(@FWindowInfo, FDefaultUrl, @FBrowserSettings, aContext); | ||||
|       end; | ||||
|   except | ||||
|     on e : exception do | ||||
|       if CustomExceptionHandler('TFMXChromium.CreateBrowser', e) then raise; | ||||
|   end; | ||||
| end; | ||||
| {$ENDIF} | ||||
|  | ||||
| function TFMXChromium.ShareRequestContext(var   aContext : ICefRequestContext; | ||||
|                                           const aHandler : ICefRequestContextHandler) : boolean; | ||||
| begin | ||||
|   | ||||
							
								
								
									
										151
									
								
								source/uFMXWindowParent.pas
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										151
									
								
								source/uFMXWindowParent.pas
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,151 @@ | ||||
| // ************************************************************************ | ||||
| // ***************************** CEF4Delphi ******************************* | ||||
| // ************************************************************************ | ||||
| // | ||||
| // CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based | ||||
| // browser in Delphi applications. | ||||
| // | ||||
| // The original license of DCEF3 still applies to CEF4Delphi. | ||||
| // | ||||
| // For more information about CEF4Delphi visit : | ||||
| //         https://www.briskbard.com/index.php?lang=en&pageid=cef | ||||
| // | ||||
| //        Copyright � 2018 Salvador D�az Fau. All rights reserved. | ||||
| // | ||||
| // ************************************************************************ | ||||
| // ************ vvvv Original license and comments below vvvv ************* | ||||
| // ************************************************************************ | ||||
| (* | ||||
|  *                       Delphi Chromium Embedded 3 | ||||
|  * | ||||
|  * Usage allowed under the restrictions of the Lesser GNU General Public License | ||||
|  * or alternatively the restrictions of the Mozilla Public License 1.1 | ||||
|  * | ||||
|  * Software distributed under the License is distributed on an "AS IS" basis, | ||||
|  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for | ||||
|  * the specific language governing rights and limitations under the License. | ||||
|  * | ||||
|  * Unit owner : Henri Gourvest <hgourvest@gmail.com> | ||||
|  * Web site   : http://www.progdigy.com | ||||
|  * Repository : http://code.google.com/p/delphichromiumembedded/ | ||||
|  * Group      : http://groups.google.com/group/delphichromiumembedded | ||||
|  * | ||||
|  * Embarcadero Technologies, Inc is not permitted to use or redistribute | ||||
|  * this source code without explicit permission. | ||||
|  * | ||||
|  *) | ||||
|  | ||||
| unit uFMXWindowParent; | ||||
|  | ||||
| {$IFNDEF CPUX64} | ||||
|   {$ALIGN ON} | ||||
|   {$MINENUMSIZE 4} | ||||
| {$ENDIF} | ||||
|  | ||||
| {$I cef.inc} | ||||
|  | ||||
| interface | ||||
|  | ||||
| uses | ||||
|   System.Classes, System.Types, System.UITypes, | ||||
|   {$IFDEF MSWINDOWS} | ||||
|   WinApi.Windows, | ||||
|   {$ENDIF} | ||||
|   FMX.Controls, FMX.Types, FMX.Forms; | ||||
|  | ||||
| type | ||||
|   TFMXWindowParent = class(TCommonCustomForm) | ||||
|     protected | ||||
|       {$IFDEF MSWINDOWS} | ||||
|       function  GetChildWindowHandle : HWND; | ||||
|       procedure UpdateSize; | ||||
|       {$ENDIF} | ||||
|       procedure Resize; override; | ||||
|  | ||||
|     public | ||||
|       {$IFDEF MSWINDOWS} | ||||
|       procedure Reparent(const aNewParentHandle : TWindowHandle); | ||||
|       property  ChildWindowHandle : HWND   read GetChildWindowHandle; | ||||
|       {$ENDIF} | ||||
|  | ||||
|     published | ||||
|       property Visible; | ||||
|       property Height; | ||||
|       property Width; | ||||
|   end; | ||||
|  | ||||
| implementation | ||||
|  | ||||
| // This class inherits from TCommonCustomForm because CEF needs a Windows handle | ||||
| // to create the browser in normal mode. | ||||
|  | ||||
| // TFMXWindowParent has to be created and resized at runtime. | ||||
| // It's also necessary to call "Reparent" to add this component as a child component to your form. | ||||
|  | ||||
| uses | ||||
|   System.SysUtils, FMX.Platform, FMX.Platform.Win; | ||||
|  | ||||
| procedure TFMXWindowParent.Resize; | ||||
| begin | ||||
|   inherited Resize; | ||||
|  | ||||
|   {$IFDEF MSWINDOWS} | ||||
|   UpdateSize; | ||||
|   {$ENDIF} | ||||
| end; | ||||
|  | ||||
| {$IFDEF MSWINDOWS} | ||||
| function TFMXWindowParent.GetChildWindowHandle : HWND; | ||||
| var | ||||
|   TempHWND : HWND; | ||||
| begin | ||||
|   TempHWND := FmxHandleToHWND(Handle); | ||||
|   Result   := WinApi.Windows.GetWindow(TempHWND, GW_CHILD); | ||||
| end; | ||||
|  | ||||
| procedure TFMXWindowParent.UpdateSize; | ||||
| var | ||||
|   TempHWND, TempChildHWND : HWND; | ||||
|   TempRect : System.Types.TRect; | ||||
|   TempClientRect : TRectF; | ||||
| begin | ||||
|   TempChildHWND := ChildWindowHandle; | ||||
|   if (TempChildHWND = 0) then exit; | ||||
|  | ||||
|   TempHWND := BeginDeferWindowPos(1); | ||||
|  | ||||
|   try | ||||
|     TempClientRect  := ClientRect; | ||||
|     TempRect.Left   := round(TempClientRect.Left); | ||||
|     TempRect.Top    := round(TempClientRect.Top); | ||||
|     TempRect.Right  := round(TempClientRect.Right); | ||||
|     TempRect.Bottom := round(TempClientRect.Bottom); | ||||
|  | ||||
|     TempHWND := DeferWindowPos(TempHWND, TempChildHWND, HWND_TOP, | ||||
|                                TempRect.left, TempRect.top, TempRect.right - TempRect.left, TempRect.bottom - TempRect.top, | ||||
|                                SWP_NOZORDER); | ||||
|   finally | ||||
|     EndDeferWindowPos(TempHWND); | ||||
|   end; | ||||
| end; | ||||
|  | ||||
| procedure TFMXWindowParent.Reparent(const aNewParentHandle : TWindowHandle); | ||||
| var | ||||
|   TempChildHandle, TempParentHandle : HWND; | ||||
| begin | ||||
|   if (aNewParentHandle <> nil) then | ||||
|     begin | ||||
|       TempChildHandle  := FmxHandleToHWND(Handle); | ||||
|       TempParentHandle := FmxHandleToHWND(aNewParentHandle); | ||||
|  | ||||
|       if (TempChildHandle <> 0) and (TempParentHandle <> 0) then | ||||
|         begin | ||||
|           SetWindowLong(TempChildHandle, GWL_STYLE, WS_CHILDWINDOW); | ||||
|           WinApi.Windows.SetParent(TempChildHandle, TempParentHandle); | ||||
|         end; | ||||
|     end; | ||||
| end; | ||||
| {$ENDIF} | ||||
|  | ||||
|  | ||||
| end. | ||||
		Reference in New Issue
	
	Block a user