Update to CEF 94.4.1

Added the keyboard handling modification to the OSRExternalPumpBrowser demo requested by mterrisse in issue #378
Fixed the wrong form icon in TinyBrowser demo.
This commit is contained in:
salvadordf 2021-09-27 12:04:33 +02:00
parent fe3d171c5b
commit c88ec15bd4
44 changed files with 981 additions and 170 deletions

View File

@ -3,16 +3,16 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro
CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
CEF4Delphi uses CEF 93.1.14 which includes Chromium 93.0.4577.82.
CEF4Delphi uses CEF 94.4.1 which includes Chromium 94.0.4606.54.
The CEF binaries used by CEF4Delphi are available for download at Spotify :
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_93.1.14%2Bgf38ce34%2Bchromium-93.0.4577.82_windows32.tar.bz2)
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_93.1.14%2Bgf38ce34%2Bchromium-93.0.4577.82_windows64.tar.bz2)
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_93.1.14%2Bgf38ce34%2Bchromium-93.0.4577.82_linux32.tar.bz2)
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_93.1.14%2Bgf38ce34%2Bchromium-93.0.4577.82_linux64.tar.bz2)
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_93.1.14%2Bgf38ce34%2Bchromium-93.0.4577.82_linuxarm.tar.bz2)
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_93.1.14%2Bgf38ce34%2Bchromium-93.0.4577.82_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_93.1.14%2Bgf38ce34%2Bchromium-93.0.4577.82_macosx64.tar.bz2)
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_94.4.1%2Bg4b61a8c%2Bchromium-94.0.4606.54_windows32.tar.bz2)
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_94.4.1%2Bg4b61a8c%2Bchromium-94.0.4606.54_windows64.tar.bz2)
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_94.4.1%2Bg4b61a8c%2Bchromium-94.0.4606.54_linux32.tar.bz2)
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_94.4.1%2Bg4b61a8c%2Bchromium-94.0.4606.54_linux64.tar.bz2)
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_94.4.1%2Bg4b61a8c%2Bchromium-94.0.4606.54_linuxarm.tar.bz2)
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_94.4.1%2Bg4b61a8c%2Bchromium-94.0.4606.54_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_94.4.1%2Bg4b61a8c%2Bchromium-94.0.4606.54_macosx64.tar.bz2)
CEF4Delphi was developed and tested on Delphi 11.0 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3, Delphi 10.4 and Lazarus 2.0.12/FPC 3.2.0. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.

View File

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{3B58D3C2-1F7F-4146-A307-5F778CD7C586}</ProjectGuid>
<ProjectVersion>19.2</ProjectVersion>
<ProjectVersion>19.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>DOMVisitor.dpr</MainSource>
<Base>True</Base>
@ -134,10 +134,6 @@
<DCCReference Include="uDOMVisitor.pas">
<Form>DOMVisitorFrm</Form>
</DCCReference>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -145,6 +141,10 @@
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
@ -175,6 +175,16 @@
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClasses">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
@ -476,6 +486,11 @@
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -503,6 +518,11 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
@ -531,6 +551,11 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
@ -560,6 +585,10 @@
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -1141,6 +1170,10 @@
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXEntitlements">
<Platform Name="OSX32">
@ -1151,6 +1184,10 @@
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXInfoPList">
<Platform Name="OSX32">
@ -1161,6 +1198,10 @@
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
@ -1171,6 +1212,10 @@
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
@ -1201,6 +1246,10 @@
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -1239,16 +1288,17 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>

View File

@ -10,7 +10,6 @@ object DOMVisitorFrm: TDOMVisitorFrm
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate

View File

@ -552,6 +552,8 @@ begin
MsgContents := 'Search box information: ' + quotedstr(MsgContents);
PostMessage(Handle, MINIBROWSER_SHOWMESSAGE, 0, 0);
Result := True;
end;
end;

View File

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{7DC52040-59FF-4430-BF65-3A852AB5A6C0}</ProjectGuid>
<ProjectVersion>19.2</ProjectVersion>
<ProjectVersion>19.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>OSRExternalPumpBrowser.dpr</MainSource>
<Base>True</Base>
@ -134,10 +134,6 @@
<DCCReference Include="uOSRExternalPumpBrowser.pas">
<Form>OSRExternalPumpBrowserFrm</Form>
</DCCReference>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -145,6 +141,10 @@
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
@ -181,6 +181,16 @@
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClasses">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
@ -482,6 +492,11 @@
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -509,6 +524,11 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
@ -537,6 +557,11 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
@ -566,6 +591,10 @@
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -1147,6 +1176,10 @@
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXEntitlements">
<Platform Name="OSX32">
@ -1157,6 +1190,10 @@
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXInfoPList">
<Platform Name="OSX32">
@ -1167,6 +1204,10 @@
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
@ -1177,6 +1218,10 @@
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
@ -1207,6 +1252,10 @@
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -1245,16 +1294,17 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>

View File

@ -10,7 +10,6 @@ object OSRExternalPumpBrowserFrm: TOSRExternalPumpBrowserFrm
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnAfterMonitorDpiChanged = FormAfterMonitorDpiChanged
OnCloseQuery = FormCloseQuery
@ -73,7 +72,7 @@ object OSRExternalPumpBrowserFrm: TOSRExternalPumpBrowserFrm
Height = 20
Margins.Left = 5
Align = alLeft
Caption = 'Go'
Caption = '&Go'
TabOrder = 0
OnClick = GoBtnClick
OnEnter = GoBtnEnter

View File

@ -198,6 +198,8 @@ var
TempMouseEvent : TCefMouseEvent;
TempPoint : TPoint;
begin
if Handled then exit;
case Msg.message of
WM_SYSCHAR :
if Panel1.Focused then
@ -274,6 +276,7 @@ begin
TempKeyEvent.focus_on_editable_field := ord(False);
chrmosr.SendKeyEvent(@TempKeyEvent);
Handled := (Msg.wParam <> VK_MENU);
end;
WM_CHAR :
@ -290,6 +293,7 @@ begin
CefCheckAltGrPressed(Msg.wParam, TempKeyEvent);
chrmosr.SendKeyEvent(@TempKeyEvent);
Handled := True;
end;
WM_MOUSEWHEEL :

View File

@ -10,9 +10,11 @@ del /s /q *.local
del /s /q *.~*
rmdir Win32\Debug
rmdir Win32\Release
rmdir "Win32\Debug mem alloc"
rmdir Win32
rmdir Win64\Debug
rmdir Win64\Release
rmdir "Win64\Debug mem alloc"
rmdir Win64
rmdir __history
rmdir __recovery

View File

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{1D68E0C9-A421-451F-83EC-8AE197E0F21F}</ProjectGuid>
<ProjectVersion>19.2</ProjectVersion>
<ProjectVersion>19.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>TinyBrowser.dpr</MainSource>
<Base>True</Base>
@ -138,14 +138,14 @@
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Debug mem alloc">
<Key>Cfg_3</Key>
<CfgParent>Base</CfgParent>
@ -184,6 +184,16 @@
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClasses">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
@ -485,6 +495,11 @@
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -512,6 +527,11 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
@ -540,6 +560,11 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
@ -569,6 +594,10 @@
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -1106,6 +1135,10 @@
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXEntitlements">
<Platform Name="OSX32">
@ -1116,6 +1149,10 @@
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXInfoPList">
<Platform Name="OSX32">
@ -1126,6 +1163,10 @@
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
@ -1136,6 +1177,10 @@
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
@ -1166,6 +1211,10 @@
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -1204,16 +1253,17 @@
<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="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>

View File

@ -43,9 +43,9 @@ interface
uses
{$IFDEF DELPHI16_UP}
System.Classes, System.Types, System.SysUtils,
WinApi.Windows, System.Classes, System.Types, System.SysUtils, Vcl.Forms, Winapi.Messages,
{$ELSE}
Classes, Types, SysUtils,
Windows, Classes, Types, SysUtils, Forms, Messages,
{$ENDIF}
uCEFTypes, uCEFInterfaces, uCEFConstants, uCEFApplication, uCEFChromium,
uCEFWindowComponent, uCEFBrowserViewComponent;
@ -71,6 +71,7 @@ type
procedure Chromium_OnBeforeClose(Sender: TObject; const browser: ICefBrowser);
procedure Chromium_OnBeforePopup(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 extra_info: ICefDictionaryValue; var noJavascriptAccess, Result: Boolean);
procedure Chromium_OnOpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
procedure Chromium_OnTitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
procedure CEFWindowComponent_OnWindowCreated(const Sender : TObject; const window : ICefWindow);
@ -156,10 +157,11 @@ procedure TTinyBrowser.AfterConstruction;
begin
inherited AfterConstruction;
FChromium := TChromium.Create(self);
FChromium.OnBeforeClose := Chromium_OnBeforeClose;
FChromium.OnBeforePopup := Chromium_OnBeforePopup;
FChromium.OnTitleChange := Chromium_OnTitleChange;
FChromium := TChromium.Create(self);
FChromium.OnBeforeClose := Chromium_OnBeforeClose;
FChromium.OnBeforePopup := Chromium_OnBeforePopup;
FChromium.OnOpenUrlFromTab := Chromium_OnOpenUrlFromTab;
FChromium.OnTitleChange := Chromium_OnTitleChange;
FCEFBrowserViewComponent := TCEFBrowserViewComponent.Create(self);
@ -199,6 +201,18 @@ begin
Result := (targetDisposition in [WOD_NEW_FOREGROUND_TAB, WOD_NEW_BACKGROUND_TAB, WOD_NEW_POPUP, WOD_NEW_WINDOW]);
end;
procedure TTinyBrowser.Chromium_OnOpenUrlFromTab( Sender : TObject;
const browser : ICefBrowser;
const frame : ICefFrame;
const targetUrl : ustring;
targetDisposition : TCefWindowOpenDisposition;
userGesture : Boolean;
out 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 TTinyBrowser.Chromium_OnTitleChange( Sender : TObject;
const browser : ICefBrowser;
const title : ustring);
@ -230,6 +244,9 @@ begin
end;
FCEFBrowserViewComponent.RequestFocus;
// This is an alternative way to set the form icon.
SendMessage(FCEFWindowComponent.WindowHandle, WM_SETICON, 1, Application.Icon.Handle);
end;
end;
@ -275,12 +292,12 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.ExternalMessagePump := False;
//GlobalCEFApp.ChromeRuntime := True; // Enable this line to test the new "ChromeRuntime" mode. It's in experimental state.
GlobalCEFApp.ChromeRuntime := True; // Enable this line to test the new "ChromeRuntime" mode. It's in experimental state.
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient; // This event is only used in "ChromeRuntime" mode
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE;
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
end;
procedure DestroyTinyBrowser;

View File

@ -10,9 +10,11 @@ del /s /q *.local
del /s /q *.~*
rmdir Win32\Debug
rmdir Win32\Release
rmdir "Win32\Debug mem alloc"
rmdir Win32
rmdir Win64\Debug
rmdir Win64\Release
rmdir "Win64\Debug mem alloc"
rmdir Win64
rmdir __history
rmdir __recovery

View File

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{517C64DC-EC82-4877-A799-FFD153AF96A2}</ProjectGuid>
<ProjectVersion>19.2</ProjectVersion>
<ProjectVersion>19.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>TinyBrowser2.dpr</MainSource>
<Base>True</Base>
@ -106,10 +106,6 @@
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="uTinyBrowser2.pas"/>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -117,6 +113,10 @@
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
@ -151,6 +151,16 @@
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClasses">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
@ -452,6 +462,11 @@
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -479,6 +494,11 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
@ -507,6 +527,11 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
@ -536,6 +561,10 @@
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -801,6 +830,10 @@
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXEntitlements">
<Platform Name="OSX32">
@ -811,6 +844,10 @@
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXInfoPList">
<Platform Name="OSX32">
@ -821,6 +858,10 @@
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
@ -831,6 +872,10 @@
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
@ -861,6 +906,10 @@
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -899,16 +948,17 @@
<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="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>

View File

@ -43,9 +43,9 @@ interface
uses
{$IFDEF DELPHI16_UP}
System.Types, System.SysUtils,
WinApi.Windows, System.Types, System.SysUtils, Vcl.Forms, Winapi.Messages,
{$ELSE}
Types, SysUtils,
Windows, Types, SysUtils, Forms, Messages,
{$ENDIF}
uCEFInterfaces, uCEFTypes, uCEFChromiumCore;
@ -109,7 +109,7 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.ExternalMessagePump := False;
GlobalCEFApp.ChromeRuntime := True; // Enable this line to enable the "ChromeRuntime" mode. It's in experimental state.
//GlobalCEFApp.ChromeRuntime := True; // Enable this line to enable the "ChromeRuntime" mode. It's in experimental state.
GlobalCEFApp.cache := 'cache';
GlobalCEFApp.DisablePopupBlocking := True;
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
@ -118,6 +118,9 @@ begin
// This is a workaround for the CEF4Delphi issue #324 :
// https://github.com/salvadordf/CEF4Delphi/issues/324
GlobalCEFApp.DisableFeatures := 'WinUseBrowserSpellChecker';
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
end;
procedure DestroyTinyBrowser;

View File

@ -42,7 +42,7 @@ unit uTinyBrowser;
interface
uses
Classes,
Windows, Classes, Forms, Messages,
uCEFTypes, uCEFInterfaces, uCEFConstants, uCEFApplication, uCEFChromium,
uCEFWindowComponent, uCEFBrowserViewComponent;
@ -225,7 +225,9 @@ begin
FCEFWindowComponent.Position := TempPosition;
end;
FCEFBrowserViewComponent.RequestFocus;
FCEFBrowserViewComponent.RequestFocus;
SendMessage(FCEFWindowComponent.WindowHandle, WM_SETICON, 1, application.Icon.Handle);
end;
end;

View File

@ -224,6 +224,8 @@ contains
uCEFWorkSchedulerQueueThread in '..\source\uCEFWorkSchedulerQueueThread.pas',
uCEFLinkedWinControlBase in '..\source\uCEFLinkedWinControlBase.pas',
uCEFTimerWorkScheduler in '..\source\uCEFTimerWorkScheduler.pas',
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas';
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas',
uCEFOverlayController in '..\source\uCEFOverlayController.pas';
end.

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<ProjectGuid>{2F51F1BD-0529-4B4A-BFD2-86FE96910A62}</ProjectGuid>
<MainSource>CEF4Delphi.dpk</MainSource>
<ProjectVersion>19.2</ProjectVersion>
<ProjectVersion>19.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
@ -319,17 +319,18 @@
<DCCReference Include="..\source\uCEFLinkedWinControlBase.pas"/>
<DCCReference Include="..\source\uCEFTimerWorkScheduler.pas"/>
<DCCReference Include="..\source\uCEFFrameHandler.pas"/>
<DCCReference Include="..\source\uCEFOverlayController.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Debug with optimization">
<Key>Cfg_3</Key>
<CfgParent>Base</CfgParent>
@ -351,16 +352,16 @@
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="3">
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule"/>
<DeployFile LocalName="..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\17.0\Bpl\CEF4Delphi.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libPCRE.dylib" Class="DependencyModule"/>
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule"/>
<DeployFile LocalName="..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\20.0\Bpl\CEF4Delphi.bpl" Configuration="Debug" Class="ProjectOutput">
<DeployFile LocalName="..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\22.0\Bpl\CEF4Delphi.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>CEF4Delphi.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\17.0\Bpl\CEF4Delphi.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule"/>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
@ -369,6 +370,16 @@
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClasses">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
@ -667,6 +678,10 @@
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -680,6 +695,10 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
@ -706,6 +725,10 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
@ -733,6 +756,9 @@
<Platform Name="OSX64">
<Operation>0</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -1286,6 +1312,10 @@
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
@ -1314,6 +1344,9 @@
<Platform Name="OSX64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -1352,16 +1385,17 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>

View File

@ -221,6 +221,7 @@ contains
uCEFWorkSchedulerQueueThread in '..\source\uCEFWorkSchedulerQueueThread.pas',
uCEFLinkedWinControlBase in '..\source\uCEFLinkedWinControlBase.pas',
uCEFTimerWorkScheduler in '..\source\uCEFTimerWorkScheduler.pas',
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas';
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas',
uCEFOverlayController in '..\source\uCEFOverlayController.pas';
end.

View File

@ -236,7 +236,8 @@ contains
uCEFTimerWorkScheduler in '..\source\uCEFTimerWorkScheduler.pas',
uCEFMacOSCustomCocoaTimer in '..\source\uCEFMacOSCustomCocoaTimer.pas',
uCEFMacOSInterfaces in '..\source\uCEFMacOSInterfaces.pas',
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas';
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas',
uCEFOverlayController in '..\source\uCEFOverlayController.pas';
end.

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<ProjectGuid>{2F51F1BD-0529-4B4A-BFD2-86FE96910A62}</ProjectGuid>
<MainSource>CEF4Delphi_FMX.dpk</MainSource>
<ProjectVersion>19.2</ProjectVersion>
<ProjectVersion>19.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
@ -352,25 +352,26 @@
<DCCReference Include="..\source\uCEFMacOSCustomCocoaTimer.pas"/>
<DCCReference Include="..\source\uCEFMacOSInterfaces.pas"/>
<DCCReference Include="..\source\uCEFFrameHandler.pas"/>
<DCCReference Include="..\source\uCEFOverlayController.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug with logging">
<Key>Cfg_4</Key>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Debug with optimization">
<Key>Cfg_3</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Debug with logging">
<Key>Cfg_4</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
@ -388,28 +389,28 @@
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="3">
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule"/>
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule"/>
<DeployFile LocalName="..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\19.0\Bpl\CEF4Delphi_FMX.bpl" Configuration="Release" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>CEF4Delphi_FMX.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\21.0\Bpl\CEF4Delphi_FMX.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>CEF4Delphi_FMX.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\17.0\Bpl\CEF4Delphi.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libPCRE.dylib" Class="DependencyModule"/>
<DeployFile LocalName="..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\19.0\Bpl\CEF4Delphi_FMX.bpl" Configuration="Debug with logging" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>CEF4Delphi_FMX.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\22.0\Bpl\CEF4Delphi_FMX.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>CEF4Delphi_FMX.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\19.0\Bpl\CEF4Delphi_FMX.bpl" Configuration="Release" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>CEF4Delphi_FMX.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule"/>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libPCRE.dylib" Class="DependencyModule"/>
<DeployFile LocalName="..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\17.0\Bpl\CEF4Delphi.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule"/>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
@ -418,6 +419,16 @@
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClasses">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
@ -716,6 +727,10 @@
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -729,6 +744,10 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
@ -755,6 +774,10 @@
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
@ -782,6 +805,9 @@
<Platform Name="OSX64">
<Operation>0</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -1335,6 +1361,10 @@
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
@ -1363,6 +1393,9 @@
<Platform Name="OSX64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
@ -1401,16 +1434,17 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>

View File

@ -21,8 +21,8 @@
</CompilerOptions>
<Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/>
<License Value="MPL 1.1"/>
<Version Major="93" Minor="1" Release="14"/>
<Files Count="202">
<Version Major="94" Minor="4" Release="1"/>
<Files Count="203">
<Item1>
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
<UnitName Value="uCEFAccessibilityHandler"/>
@ -849,6 +849,10 @@
<Filename Value="..\source\uCEFFrameHandler.pas"/>
<UnitName Value="uCEFFrameHandler"/>
</Item202>
<Item203>
<Filename Value="..\source\uCEFOverlayController.pas"/>
<UnitName Value="uCEFOverlayController"/>
</Item203>
</Files>
<RequiredPkgs Count="5">
<Item1>

View File

@ -66,7 +66,7 @@ uses
uCEFLinuxFunctions, uCEFLinuxTypes, uCEFLinuxConstants,
uCEFWorkSchedulerQueueThread, uCEFLinkedWinControlBase, uCEFLazarusCocoa,
uCEFBrowserWindow, uCEFOsrBrowserWindow, uCEFTimerWorkScheduler,
uCEFFrameHandler, LazarusPackageIntf;
uCEFFrameHandler, uCEFOverlayController, LazarusPackageIntf;
implementation

View File

@ -64,15 +64,15 @@ uses
uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar;
const
CEF_SUPPORTED_VERSION_MAJOR = 93;
CEF_SUPPORTED_VERSION_MINOR = 1;
CEF_SUPPORTED_VERSION_RELEASE = 14;
CEF_SUPPORTED_VERSION_MAJOR = 94;
CEF_SUPPORTED_VERSION_MINOR = 4;
CEF_SUPPORTED_VERSION_RELEASE = 1;
CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 93;
CEF_CHROMEELF_VERSION_MAJOR = 94;
CEF_CHROMEELF_VERSION_MINOR = 0;
CEF_CHROMEELF_VERSION_RELEASE = 4577;
CEF_CHROMEELF_VERSION_BUILD = 82;
CEF_CHROMEELF_VERSION_RELEASE = 4606;
CEF_CHROMEELF_VERSION_BUILD = 54;
{$IFDEF MSWINDOWS}
LIBCEF_DLL = 'libcef.dll';
@ -295,6 +295,7 @@ type
function Load_cef_crash_util_h : boolean;
function Load_cef_drag_data_capi_h : boolean;
function Load_cef_file_util_capi_h : boolean;
function Load_cef_i18n_util_capi_h : boolean;
function Load_cef_image_capi_h : boolean;
function Load_cef_menu_model_capi_h : boolean;
function Load_cef_media_router_capi_h : boolean;
@ -2430,6 +2431,7 @@ begin
Load_cef_crash_util_h and
Load_cef_drag_data_capi_h and
Load_cef_file_util_capi_h and
Load_cef_i18n_util_capi_h and
Load_cef_image_capi_h and
Load_cef_menu_model_capi_h and
Load_cef_media_router_capi_h and
@ -2585,6 +2587,13 @@ begin
assigned(cef_load_crlsets_file);
end;
function TCefApplicationCore.Load_cef_i18n_util_capi_h : boolean;
begin
{$IFDEF FPC}Pointer({$ENDIF}cef_is_rtl{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_is_rtl');
Result := assigned(cef_is_rtl);
end;
function TCefApplicationCore.Load_cef_image_capi_h : boolean;
begin
{$IFDEF FPC}Pointer({$ENDIF}cef_image_create{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_image_create');

View File

@ -95,6 +95,7 @@ type
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
procedure OnFocus(const view: ICefView); override;
procedure OnBlur(const view: ICefView); override;
@ -391,6 +392,17 @@ begin
end;
end;
procedure TCustomBrowserViewDelegate.OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
begin
try
if (FEvents <> nil) then
ICefBrowserViewDelegateEvents(FEvents).doOnLayoutChanged(view, new_bounds);
except
on e : exception do
if CustomExceptionHandler('TCustomBrowserViewDelegate.OnLayoutChanged', e) then raise;
end;
end;
procedure TCustomBrowserViewDelegate.OnFocus(const view: ICefView);
begin
try

View File

@ -88,6 +88,7 @@ type
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
procedure OnFocus(const view: ICefView); override;
procedure OnBlur(const view: ICefView); override;
@ -270,6 +271,17 @@ begin
end;
end;
procedure TCustomButtonDelegate.OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
begin
try
if (FEvents <> nil) then
ICefButtonDelegateEvents(FEvents).doOnLayoutChanged(view, new_bounds);
except
on e : exception do
if CustomExceptionHandler('TCustomButtonDelegate.OnLayoutChanged', e) then raise;
end;
end;
procedure TCustomButtonDelegate.OnFocus(const view: ICefView);
begin
try

View File

@ -640,7 +640,7 @@ type
// ICefFrameHandler
procedure doOnFrameCreated(const browser: ICefBrowser; const frame: ICefFrame);
procedure doOnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame);
procedure doOnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean);
procedure doOnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame);
procedure doOnMainFrameChanged(const browser: ICefBrowser; const old_frame, new_frame: ICefFrame);
@ -5751,10 +5751,10 @@ begin
FOnFrameCreated(self, browser, frame);
end;
procedure TChromiumCore.doOnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame);
procedure TChromiumCore.doOnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean);
begin
if assigned(FOnFrameAttached) then
FOnFrameAttached(self, browser, frame);
FOnFrameAttached(self, browser, frame, reattached);
end;
procedure TChromiumCore.doOnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame);

View File

@ -210,7 +210,7 @@ type
// ICefFrameHandler
TOnFrameCreated = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame) of object;
TOnFrameAttached = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame) of object;
TOnFrameAttached = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean) of object;
TOnFrameDetached = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame) of object;
TOnMainFrameChanged = procedure(Sender: TObject; const browser: ICefBrowser; const old_frame, new_frame: ICefFrame) of object;

View File

@ -558,6 +558,19 @@ const
CEF_CTT_NORMAL = 2;
CEF_CTT_LOCATION = 3;
// /include/internal/cef_types.h (cef_docking_mode_t)
CEF_DOCKING_MODE_TOP_LEFT = 1;
CEF_DOCKING_MODE_TOP_RIGHT = 2;
CEF_DOCKING_MODE_BOTTOM_LEFT = 3;
CEF_DOCKING_MODE_BOTTOM_RIGHT = 4;
CEF_DOCKING_MODE_CUSTOM = 5;
// /include/internal/cef_types.h (cef_show_state_t)
CEF_SHOW_STATE_NORMAL = 1;
CEF_SHOW_STATE_MINIMIZED = 2;
CEF_SHOW_STATE_MAXIMIZED = 3;
CEF_SHOW_STATE_FULLSCREEN = 4;
// /include/cef_api_hash.h (used as "cef_api_hash" parameters)
CEF_API_HASH_PLATFORM = 0;
CEF_API_HASH_UNIVERSAL = 1;

View File

@ -55,7 +55,7 @@ type
TCefFrameHandlerOwn = class(TCefBaseRefCountedOwn, ICefFrameHandler)
protected
procedure OnFrameCreated(const browser: ICefBrowser; const frame: ICefFrame); virtual;
procedure OnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame); virtual;
procedure OnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean); virtual;
procedure OnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame); virtual;
procedure OnMainFrameChanged(const browser: ICefBrowser; const old_frame, new_frame: ICefFrame); virtual;
@ -70,7 +70,7 @@ type
FEvents : Pointer;
procedure OnFrameCreated(const browser: ICefBrowser; const frame: ICefFrame); override;
procedure OnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame); override;
procedure OnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean); override;
procedure OnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame); override;
procedure OnMainFrameChanged(const browser: ICefBrowser; const old_frame, new_frame: ICefFrame); override;
@ -105,7 +105,7 @@ begin
TCefFrameRef.UnWrap(frame));
end;
procedure cef_frame_handler_on_frame_attached(self: PCefFrameHandler; browser: PCefBrowser; frame: PCefFrame); stdcall;
procedure cef_frame_handler_on_frame_attached(self: PCefFrameHandler; browser: PCefBrowser; frame: PCefFrame; reattached: integer); stdcall;
var
TempObject : TObject;
begin
@ -113,7 +113,8 @@ begin
if (TempObject <> nil) and (TempObject is TCefFrameHandlerOwn) then
TCefFrameHandlerOwn(TempObject).OnFrameAttached(TCefBrowserRef.UnWrap(browser),
TCefFrameRef.UnWrap(frame));
TCefFrameRef.UnWrap(frame),
reattached <> 0);
end;
procedure cef_frame_handler_on_frame_detached(self: PCefFrameHandler; browser: PCefBrowser; frame: PCefFrame); stdcall;
@ -157,7 +158,7 @@ begin
//
end;
procedure TCefFrameHandlerOwn.OnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame);
procedure TCefFrameHandlerOwn.OnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean);
begin
//
end;
@ -205,10 +206,10 @@ begin
IChromiumEvents(FEvents).doOnFrameCreated(browser, frame);
end;
procedure TCustomFrameHandler.OnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame);
procedure TCustomFrameHandler.OnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean);
begin
if (FEvents <> nil) then
IChromiumEvents(FEvents).doOnFrameAttached(browser, frame);
IChromiumEvents(FEvents).doOnFrameAttached(browser, frame, reattached);
end;
procedure TCustomFrameHandler.OnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame);

View File

@ -462,7 +462,7 @@ type
// ICefFrameHandler
procedure doOnFrameCreated(const browser: ICefBrowser; const frame: ICefFrame);
procedure doOnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame);
procedure doOnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean);
procedure doOnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame);
procedure doOnMainFrameChanged(const browser: ICefBrowser; const old_frame, new_frame: ICefFrame);
@ -824,7 +824,7 @@ type
ICefFrameHandler = interface(ICefBaseRefCounted)
['{B437128C-F7CB-4F75-83CF-A257B98C0B6E}']
procedure OnFrameCreated(const browser: ICefBrowser; const frame: ICefFrame);
procedure OnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame);
procedure OnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean);
procedure OnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame);
procedure OnMainFrameChanged(const browser: ICefBrowser; const old_frame, new_frame: ICefFrame);
@ -2556,6 +2556,42 @@ type
['{3DB214F2-7F27-4306-82C9-8166160422B1}']
end;
// TCefOverlayController
// /include/capi/views/cef_overlay_controller_capi.h (cef_overlay_controller_t)
ICefOverlayController = interface(ICefBaseRefCounted)
['{13E1F3D2-32FF-4D30-A30E-D67B6A4846AB}']
function IsValid: boolean;
function IsSame(const that: ICefOverlayController): boolean;
function GetContentsView: ICefView;
function GetWindow: ICefWindow;
function GetDockingMode: TCefDockingMode;
procedure DestroyOverlay;
procedure SetBounds(const bounds: TCefRect);
function GetBounds: TCefRect;
function GetBoundsInScreen: TCefRect;
procedure SetSize(const size: TCefSize);
function GetSize: TCefSize;
procedure SetPosition(const position: TCefPoint);
function GetPosition: TCefPoint;
procedure SetInsets(const insets: TCefInsets);
function GetInsets: TCefInsets;
procedure SizeToPreferredSize;
procedure SetVisible(visible: boolean);
function IsVisible: boolean;
function IsDrawn: boolean;
property ContentsView : ICefView read GetContentsView;
property Window : ICefWindow read GetWindow;
property DockingMode : TCefDockingMode read GetDockingMode;
property Bounds : TCefRect read GetBounds write SetBounds;
property BoundsInScreen : TCefRect read GetBoundsInScreen;
property Size : TCefSize read GetSize write SetSize;
property Position : TCefPoint read GetPosition write SetPosition;
property Insets : TCefInsets read GetInsets write SetInsets;
property Visible : boolean read IsVisible write SetVisible;
property Drawn : boolean read IsDrawn;
end;
// TCefView
// /include/capi/views/cef_view_capi.h (cef_view_t)
ICefView = interface(ICefBaseRefCounted)
@ -2585,6 +2621,8 @@ type
function GetSize : TCefSize;
procedure SetPosition(const position_: TCefPoint);
function GetPosition : TCefPoint;
procedure SetInsets(const insets: TCefInsets);
function GetInsets: TCefInsets;
function GetPreferredSize : TCefSize;
procedure SizeToPreferredSize;
function GetMinimumSize : TCefSize;
@ -2629,6 +2667,7 @@ type
property Bounds : TCefRect read GetBounds write SetBounds;
property Size : TCefSize read GetSize write SetSize;
property Position : TCefPoint read GetPosition write SetPosition;
property Insets : TCefInsets read GetInsets write SetInsets;
property TypeString : ustring read GetTypeString;
end;
@ -2643,6 +2682,7 @@ type
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView);
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView);
procedure OnWindowChanged(const view: ICefView; added: boolean);
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
procedure OnFocus(const view: ICefView);
procedure OnBlur(const view: ICefView);
end;
@ -2657,6 +2697,7 @@ type
procedure doOnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView);
procedure doOnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView);
procedure doOnWindowChanged(const view: ICefView; added: boolean);
procedure doOnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
procedure doOnFocus(const view: ICefView);
procedure doOnBlur(const view: ICefView);
@ -2904,6 +2945,7 @@ type
function GetWindowIcon : ICefImage;
procedure SetWindowAppIcon(const image: ICefImage);
function GetWindowAppIcon : ICefImage;
function AddOverlayView(const view: ICefView; docking_mode: TCefDockingMode): ICefOverlayController;
procedure ShowMenu(const menu_model: ICefMenuModel; const screen_point: TCefPoint; anchor_position : TCefMenuAnchorPosition);
procedure CancelMenu;
function GetDisplay : ICefDisplay;
@ -2933,6 +2975,7 @@ type
procedure OnWindowDestroyed(const window: ICefWindow);
procedure OnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
procedure OnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect);
procedure OnGetInitialShowState(const window: ICefWindow; var aResult : TCefShowState);
procedure OnIsFrameless(const window: ICefWindow; var aResult : boolean);
procedure OnCanResize(const window: ICefWindow; var aResult : boolean);
procedure OnCanMaximize(const window: ICefWindow; var aResult : boolean);
@ -2948,6 +2991,7 @@ type
procedure doOnWindowDestroyed(const window: ICefWindow);
procedure doOnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
procedure doOnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect);
procedure doOnGetInitialShowState(const window: ICefWindow; var aResult : TCefShowState);
procedure doOnIsFrameless(const window: ICefWindow; var aResult : boolean);
procedure doOnCanResize(const window: ICefWindow; var aResult : boolean);
procedure doOnCanMaximize(const window: ICefWindow; var aResult : boolean);

View File

@ -111,6 +111,9 @@ var
cef_zip_directory : function(const src_dir, dest_file : PCefString; include_hidden_files : integer): Integer; cdecl;
cef_load_crlsets_file : procedure(const path : PCefString); cdecl;
// / include/capi/cef_i18n_util_capi.h
cef_is_rtl : function : Integer; cdecl;
// /include/capi/cef_image_capi.h
cef_image_create : function : PCefImage; cdecl;

View File

@ -86,6 +86,7 @@ type
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
procedure OnFocus(const view: ICefView); override;
procedure OnBlur(const view: ICefView); override;
@ -259,6 +260,17 @@ begin
end;
end;
procedure TCustomMenuButtonDelegate.OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
begin
try
if (FEvents <> nil) then
ICefMenuButtonDelegateEvents(FEvents).doOnLayoutChanged(view, new_bounds);
except
on e : exception do
if CustomExceptionHandler('TCustomMenuButtonDelegate.OnLayoutChanged', e) then raise;
end;
end;
procedure TCustomMenuButtonDelegate.OnFocus(const view: ICefView);
begin
try

View File

@ -238,6 +238,8 @@ function CefUriDecode(const text: ustring; convertToUtf8: Boolean; unescapeRule:
function CefGetPath(const aPathKey : TCefPathKey) : ustring;
function CefIsRTL : boolean;
function CefCreateDirectory(const fullPath: ustring): Boolean;
function CefGetTempDirectory(out tempDir: ustring): Boolean;
function CefCreateNewTempDirectory(const prefix: ustring; out newTempPath: ustring): Boolean;
@ -1750,6 +1752,13 @@ begin
Result := '';
end;
function CefIsRTL : boolean;
begin
Result := (GlobalCEFApp <> nil) and
GlobalCEFApp.LibLoaded and
(cef_is_rtl() <> 0);
end;
function CefCreateDirectory(const fullPath: ustring): Boolean;
var
TempPath : TCefString;

View File

@ -0,0 +1,193 @@
// ************************************************************************
// ***************************** CEF4Delphi *******************************
// ************************************************************************
//
// CEF4Delphi is based on DCEF3 which uses CEF 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 © 2021 Salvador Diaz 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 uCEFOverlayController;
{$IFDEF FPC}
{$MODE OBJFPC}{$H+}
{$ENDIF}
{$IFNDEF CPUX64}{$ALIGN ON}{$ENDIF}
{$MINENUMSIZE 4}
{$I cef.inc}
interface
uses
{$IFDEF DELPHI16_UP}
System.Classes, System.SysUtils,
{$ELSE}
Classes, SysUtils,
{$ENDIF}
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
type
TCefOverlayControllerRef = class(TCefBaseRefCountedRef, ICefOverlayController)
public
function IsValid: boolean;
function IsSame(const that: ICefOverlayController): boolean;
function GetContentsView: ICefView;
function GetWindow: ICefWindow;
function GetDockingMode: TCefDockingMode;
procedure DestroyOverlay;
procedure SetBounds(const bounds: TCefRect);
function GetBounds: TCefRect;
function GetBoundsInScreen: TCefRect;
procedure SetSize(const size: TCefSize);
function GetSize: TCefSize;
procedure SetPosition(const position: TCefPoint);
function GetPosition: TCefPoint;
procedure SetInsets(const insets: TCefInsets);
function GetInsets: TCefInsets;
procedure SizeToPreferredSize;
procedure SetVisible(visible: boolean);
function IsVisible: boolean;
function IsDrawn: boolean;
class function UnWrap(data: Pointer): ICefOverlayController;
end;
implementation
uses
uCEFMiscFunctions, uCEFLibFunctions, uCEFView, uCEFWindow;
function TCefOverlayControllerRef.IsValid: boolean;
begin
Result := PCefOverlayController(FData)^.is_valid(PCefOverlayController(FData)) <> 0;
end;
function TCefOverlayControllerRef.IsSame(const that: ICefOverlayController): boolean;
begin
Result := PCefOverlayController(FData)^.is_same(PCefOverlayController(FData), CefGetData(that)) <> 0;
end;
function TCefOverlayControllerRef.GetContentsView: ICefView;
begin
Result := TCefViewRef.UnWrap(PCefOverlayController(FData)^.get_contents_view(PCefOverlayController(FData)));
end;
function TCefOverlayControllerRef.GetWindow: ICefWindow;
begin
Result := TCefWindowRef.UnWrap(PCefOverlayController(FData)^.get_window(PCefOverlayController(FData)));
end;
function TCefOverlayControllerRef.GetDockingMode: TCefDockingMode;
begin
Result := PCefOverlayController(FData)^.get_docking_mode(PCefOverlayController(FData));
end;
procedure TCefOverlayControllerRef.DestroyOverlay;
begin
PCefOverlayController(FData)^.destroy(PCefOverlayController(FData));
end;
procedure TCefOverlayControllerRef.SetBounds(const bounds: TCefRect);
begin
PCefOverlayController(FData)^.set_bounds(PCefOverlayController(FData), @bounds);
end;
function TCefOverlayControllerRef.GetBounds: TCefRect;
begin
Result := PCefOverlayController(FData)^.get_bounds(PCefOverlayController(FData));
end;
function TCefOverlayControllerRef.GetBoundsInScreen: TCefRect;
begin
Result := PCefOverlayController(FData)^.get_bounds_in_screen(PCefOverlayController(FData));
end;
procedure TCefOverlayControllerRef.SetSize(const size: TCefSize);
begin
PCefOverlayController(FData)^.set_size(PCefOverlayController(FData), @size);
end;
function TCefOverlayControllerRef.GetSize: TCefSize;
begin
Result := PCefOverlayController(FData)^.get_size(PCefOverlayController(FData));
end;
procedure TCefOverlayControllerRef.SetPosition(const position: TCefPoint);
begin
PCefOverlayController(FData)^.set_position(PCefOverlayController(FData), @position);
end;
function TCefOverlayControllerRef.GetPosition: TCefPoint;
begin
Result := PCefOverlayController(FData)^.get_position(PCefOverlayController(FData));
end;
procedure TCefOverlayControllerRef.SetInsets(const insets: TCefInsets);
begin
PCefOverlayController(FData)^.set_insets(PCefOverlayController(FData), @insets);
end;
function TCefOverlayControllerRef.GetInsets: TCefInsets;
begin
Result := PCefOverlayController(FData)^.get_insets(PCefOverlayController(FData));
end;
procedure TCefOverlayControllerRef.SizeToPreferredSize;
begin
PCefOverlayController(FData)^.size_to_preferred_size(PCefOverlayController(FData));
end;
procedure TCefOverlayControllerRef.SetVisible(visible: boolean);
begin
PCefOverlayController(FData)^.set_visible(PCefOverlayController(FData), ord(visible));
end;
function TCefOverlayControllerRef.IsVisible: boolean;
begin
Result := PCefOverlayController(FData)^.is_visible(PCefOverlayController(FData)) <> 0;
end;
function TCefOverlayControllerRef.IsDrawn: boolean;
begin
Result := PCefOverlayController(FData)^.is_drawn(PCefOverlayController(FData)) <> 0;
end;
class function TCefOverlayControllerRef.UnWrap(data: Pointer): ICefOverlayController;
begin
if (data <> nil) then
Result := Create(data) as ICefOverlayController
else
Result := nil;
end;
end.

View File

@ -79,6 +79,7 @@ type
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
procedure OnFocus(const view: ICefView); override;
procedure OnBlur(const view: ICefView); override;
@ -202,6 +203,17 @@ begin
end;
end;
procedure TCustomPanelDelegate.OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
begin
try
if (FEvents <> nil) then
ICefPanelDelegateEvents(FEvents).doOnLayoutChanged(view, new_bounds);
except
on e : exception do
if CustomExceptionHandler('TCustomPanelDelegate.OnLayoutChanged', e) then raise;
end;
end;
procedure TCustomPanelDelegate.OnFocus(const view: ICefView);
begin
try

View File

@ -89,6 +89,7 @@ type
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
procedure OnFocus(const view: ICefView); override;
procedure OnBlur(const view: ICefView); override;
@ -279,6 +280,17 @@ begin
end;
end;
procedure TCustomTextfieldDelegate.OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
begin
try
if (FEvents <> nil) then
ICefTextfieldDelegateEvents(FEvents).doOnLayoutChanged(view, new_bounds);
except
on e : exception do
if CustomExceptionHandler('TCustomTextfieldDelegate.OnLayoutChanged', e) then raise;
end;
end;
procedure TCustomTextfieldDelegate.OnFocus(const view: ICefView);
begin
try

View File

@ -218,6 +218,7 @@ type
PCefLayout = ^TCefLayout;
PCefBoxLayout = ^TCefBoxLayout;
PCefFillLayout = ^TCefFillLayout;
PCefOverlayController = ^TCefOverlayController;
PCefView = ^TCefView;
PCefViewDelegate = ^TCefViewDelegate;
PCefTextfield = ^TCefTextfield;
@ -323,6 +324,8 @@ type
TCefCookiePriority = Integer; // /include/internal/cef_types.h (cef_cookie_priority_t)
TCefTextFieldCommands = Integer; // /include/internal/cef_types.h (cef_text_field_commands_t)
TCefChromeToolbarType = Integer; // /include/internal/cef_types.h (cef_chrome_toolbar_type_t)
TCefDockingMode = type Integer; // /include/internal/cef_types.h (cef_docking_mode_t)
TCefShowState = type Integer; // /include/internal/cef_types.h (cef_show_state_t)
{$IFDEF FPC}
@ -668,7 +671,10 @@ type
RT_PING,
RT_SERVICE_WORKER,
RT_CSP_REPORT,
RT_PLUGIN_RESOURCE
RT_PLUGIN_RESOURCE,
RT_EMPTY_FILLER_TYPE_DO_NOT_USE, // This type doesn't exist in CEF and it's here just to fill this position.
RT_NAVIGATION_PRELOAD_MAIN_FRAME, // This type must have a value of 19
RT_NAVIGATION_PRELOAD_SUB_FRAME
);
// /include/internal/cef_types.h (cef_dom_document_type_t)
@ -2852,7 +2858,7 @@ type
TCefFrameHandler = record
base : TCefBaseRefCounted;
on_frame_created : procedure(self: PCefFrameHandler; browser: PCefBrowser; frame: PCefFrame); stdcall;
on_frame_attached : procedure(self: PCefFrameHandler; browser: PCefBrowser; frame: PCefFrame); stdcall;
on_frame_attached : procedure(self: PCefFrameHandler; browser: PCefBrowser; frame: PCefFrame; reattached: integer); stdcall;
on_frame_detached : procedure(self: PCefFrameHandler; browser: PCefBrowser; frame: PCefFrame); stdcall;
on_main_frame_changed : procedure(self: PCefFrameHandler; browser: PCefBrowser; old_frame, new_frame: PCefFrame); stdcall;
end;
@ -3116,6 +3122,30 @@ type
base : TCefLayout;
end;
// /include/capi/views/cef_overlay_controller_capi.h (cef_overlay_controller_t)
TCefOverlayController = record
base : TCefBaseRefCounted;
is_valid : function(self: PCefOverlayController): integer; stdcall;
is_same : function(self, that: PCefOverlayController): integer; stdcall;
get_contents_view : function(self: PCefOverlayController): PCefView; stdcall;
get_window : function(self: PCefOverlayController): PCefWindow; stdcall;
get_docking_mode : function(self: PCefOverlayController): TCefDockingMode; stdcall;
destroy : procedure(self: PCefOverlayController); stdcall;
set_bounds : procedure(self: PCefOverlayController; const bounds: PCefRect); stdcall;
get_bounds : function(self: PCefOverlayController): TCefRect; stdcall;
get_bounds_in_screen : function(self: PCefOverlayController): TCefRect; stdcall;
set_size : procedure(self: PCefOverlayController; const size: PCefSize); stdcall;
get_size : function(self: PCefOverlayController): TCefSize; stdcall;
set_position : procedure(self: PCefOverlayController; const position: PCefPoint); stdcall;
get_position : function(self: PCefOverlayController): TCefPoint; stdcall;
set_insets : procedure(self: PCefOverlayController; const insets: PCefInsets); stdcall;
get_insets : function(self: PCefOverlayController): TCefInsets; stdcall;
size_to_preferred_size : procedure(self: PCefOverlayController); stdcall;
set_visible : procedure(self: PCefOverlayController; visible: integer); stdcall;
is_visible : function(self: PCefOverlayController): integer; stdcall;
is_drawn : function(self: PCefOverlayController): integer; stdcall;
end;
// /include/capi/views/cef_view_capi.h (cef_view_t)
TCefView = record
base : TCefBaseRefCounted;
@ -3144,6 +3174,8 @@ type
get_size : function(self: PCefView): TCefSize; stdcall;
set_position : procedure(self: PCefView; const position: PCefPoint); stdcall;
get_position : function(self: PCefView): TCefPoint; stdcall;
set_insets : procedure(self: PCefView; const insets: PCefInsets); stdcall;
get_insets : function(self: PCefView): TCefInsets; stdcall;
get_preferred_size : function(self: PCefView): TCefSize; stdcall;
size_to_preferred_size : procedure(self: PCefView); stdcall;
get_minimum_size : function(self: PCefView): TCefSize; stdcall;
@ -3179,6 +3211,7 @@ type
on_parent_view_changed : procedure(self: PCefViewDelegate; view: PCefView; added: Integer; parent: PCefView); stdcall;
on_child_view_changed : procedure(self: PCefViewDelegate; view: PCefView; added: Integer; child: PCefView); stdcall;
on_window_changed : procedure(self: PCefViewDelegate; view: PCefView; added: Integer); stdcall;
on_layout_changed : procedure(self: PCefViewDelegate; view: PCefView; const new_bounds: PCefRect); stdcall;
on_focus : procedure(self: PCefViewDelegate; view: PCefView); stdcall;
on_blur : procedure(self: PCefViewDelegate; view: PCefView); stdcall;
end;
@ -3357,6 +3390,7 @@ type
get_window_icon : function(self: PCefWindow): PCefImage; stdcall;
set_window_app_icon : procedure(self: PCefWindow; image: PCefImage); stdcall;
get_window_app_icon : function(self: PCefWindow): PCefImage; stdcall;
add_overlay_view : function(self: PCefWindow; view: PCefView; docking_mode: TCefDockingMode): PCefOverlayController; stdcall;
show_menu : procedure(self: PCefWindow; menu_model: PCefMenuModel; const screen_point: PCefPoint; anchor_position : TCefMenuAnchorPosition); stdcall;
cancel_menu : procedure(self: PCefWindow); stdcall;
get_display : function(self: PCefWindow): PCefDisplay; stdcall;
@ -3378,6 +3412,7 @@ type
on_window_destroyed : procedure(self: PCefWindowDelegate; window: PCefWindow); stdcall;
get_parent_window : function(self: PCefWindowDelegate; window: PCefWindow; is_menu, can_activate_menu: PInteger): PCefWindow; stdcall;
get_initial_bounds : function(self: PCefWindowDelegate; window: PCefWindow): TCefRect; stdcall;
get_initial_show_state : function(self: PCefWindowDelegate; window: PCefWindow): TCefShowState; stdcall;
is_frameless : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall;
can_resize : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall;
can_maximize : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall;

View File

@ -84,6 +84,8 @@ type
function GetSize : TCefSize;
procedure SetPosition(const position_: TCefPoint);
function GetPosition : TCefPoint;
procedure SetInsets(const insets: TCefInsets);
function GetInsets: TCefInsets;
function GetPreferredSize : TCefSize;
procedure SizeToPreferredSize;
function GetMinimumSize : TCefSize;
@ -243,6 +245,16 @@ begin
Result := PCefView(FData)^.get_position(PCefView(FData));
end;
procedure TCefViewRef.SetInsets(const insets: TCefInsets);
begin
PCefView(FData)^.set_insets(PCefView(FData), @insets);
end;
function TCefViewRef.GetInsets: TCefInsets;
begin
Result := PCefView(FData)^.get_insets(PCefView(FData));
end;
function TCefViewRef.GetPreferredSize : TCefSize;
begin
Result := PCefView(FData)^.get_preferred_size(PCefView(FData));

View File

@ -70,6 +70,7 @@ type
FOnParentViewChanged : TOnParentViewChangedEvent;
FOnChildViewChanged : TOnChildViewChangedEvent;
FOnWindowChanged : TOnWindowChangedEvent;
FOnLayoutChanged : TOnLayoutChangedEvent;
FOnFocus : TOnFocusEvent;
FOnBlur : TOnBlurEvent;
@ -126,6 +127,7 @@ type
procedure doOnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); virtual;
procedure doOnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); virtual;
procedure doOnWindowChanged(const view: ICefView; added: boolean); virtual;
procedure doOnLayoutChanged(const view: ICefView; new_bounds: TCefRect); virtual;
procedure doOnFocus(const view: ICefView); virtual;
procedure doOnBlur(const view: ICefView); virtual;
procedure doCreateCustomView; virtual;
@ -186,6 +188,7 @@ type
property OnParentViewChanged : TOnParentViewChangedEvent read FOnParentViewChanged write FOnParentViewChanged;
property OnChildViewChanged : TOnChildViewChangedEvent read FOnChildViewChanged write FOnChildViewChanged;
property OnWindowChanged : TOnWindowChangedEvent read FOnWindowChanged write FOnWindowChanged;
property OnLayoutChanged : TOnLayoutChangedEvent read FOnLayoutChanged write FOnLayoutChanged;
property OnFocus : TOnFocusEvent read FOnFocus write FOnFocus;
property OnBlur : TOnBlurEvent read FOnBlur write FOnBlur;
end;
@ -245,6 +248,7 @@ begin
FOnParentViewChanged := nil;
FOnChildViewChanged := nil;
FOnWindowChanged := nil;
FOnLayoutChanged := nil;
FOnFocus := nil;
FOnBlur := nil;
end;
@ -705,6 +709,12 @@ begin
FOnWindowChanged(self, view, added);
end;
procedure TCEFViewComponent.doOnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
begin
if assigned(FOnLayoutChanged) then
FOnLayoutChanged(self, view, new_bounds);
end;
procedure TCEFViewComponent.doOnFocus(const view: ICefView);
begin
if assigned(FOnFocus) then

View File

@ -66,6 +66,7 @@ type
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView);
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView);
procedure OnWindowChanged(const view: ICefView; added: boolean);
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
procedure OnFocus(const view: ICefView);
procedure OnBlur(const view: ICefView);
@ -82,6 +83,7 @@ type
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); virtual;
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); virtual;
procedure OnWindowChanged(const view: ICefView; added: boolean); virtual;
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); virtual;
procedure OnFocus(const view: ICefView); virtual;
procedure OnBlur(const view: ICefView); virtual;
@ -101,6 +103,7 @@ type
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
procedure OnFocus(const view: ICefView); override;
procedure OnBlur(const view: ICefView); override;
@ -164,6 +167,13 @@ begin
ord(added));
end;
procedure TCefViewDelegateRef.OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
begin
PCefViewDelegate(FData)^.on_layout_changed(PCefViewDelegate(FData),
CefGetData(view),
@new_bounds);
end;
procedure TCefViewDelegateRef.OnFocus(const view: ICefView);
begin
PCefViewDelegate(FData)^.on_focus(PCefViewDelegate(FData),
@ -292,6 +302,17 @@ begin
added <> 0);
end;
procedure cef_view_delegate_on_layout_changed(self: PCefViewDelegate; view: PCefView; const new_bounds: PCefRect); stdcall;
var
TempObject : TObject;
begin
TempObject := CefGetObject(self);
if (TempObject <> nil) and (TempObject is TCefViewDelegateOwn) then
TCefViewDelegateOwn(TempObject).OnLayoutChanged(TCefViewRef.UnWrap(view),
new_bounds^);
end;
procedure cef_view_delegate_on_focus(self: PCefViewDelegate; view: PCefView); stdcall;
var
TempObject : TObject;
@ -340,6 +361,7 @@ begin
on_parent_view_changed := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_parent_view_changed;
on_child_view_changed := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_child_view_changed;
on_window_changed := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_window_changed;
on_layout_changed := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_layout_changed;
on_focus := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_focus;
on_blur := {$IFDEF FPC}@{$ENDIF}cef_view_delegate_on_blur;
end;
@ -380,6 +402,11 @@ begin
//
end;
procedure TCefViewDelegateOwn.OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
begin
//
end;
procedure TCefViewDelegateOwn.OnFocus(const view: ICefView);
begin
//
@ -486,6 +513,17 @@ begin
end;
end;
procedure TCustomViewDelegate.OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
begin
try
if (FEvents <> nil) then
ICefViewDelegateEvents(FEvents).doOnLayoutChanged(view, new_bounds);
except
on e : exception do
if CustomExceptionHandler('TCustomViewDelegate.OnLayoutChanged', e) then raise;
end;
end;
procedure TCustomViewDelegate.OnFocus(const view: ICefView);
begin
try

View File

@ -65,6 +65,7 @@ type
TOnParentViewChangedEvent = procedure(const Sender: TObject; const view: ICefView; added: boolean; const parent: ICefView) of object;
TOnChildViewChangedEvent = procedure(const Sender: TObject; const view: ICefView; added: boolean; const child: ICefView) of object;
TOnWindowChangedEvent = procedure(const Sender: TObject; const view: ICefView; added: boolean) of object;
TOnLayoutChangedEvent = procedure(const Sender: TObject; const view: ICefView; new_bounds: TCefRect) of object;
TOnFocusEvent = procedure(const Sender: TObject; const view: ICefView) of object;
TOnBlurEvent = procedure(const Sender: TObject; const view: ICefView) of object;
@ -89,17 +90,18 @@ type
TOnMenuButtonPressedEvent = procedure(const Sender: TObject; const menu_button: ICefMenuButton; const screen_point: TCefPoint; const button_pressed_lock: ICefMenuButtonPressedLock) of object;
// ICefWindowDelegate
TOnWindowCreatedEvent = procedure(const Sender: TObject; const window: ICefWindow) of object;
TOnWindowDestroyedEvent = procedure(const Sender: TObject; const window: ICefWindow) of object;
TOnGetParentWindowEvent = procedure(const Sender: TObject; const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow) of object;
TOnGetInitialBoundsEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : TCefRect) of object;
TOnIsFramelessEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object;
TOnCanResizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object;
TOnCanMaximizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object;
TOnCanMinimizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object;
TOnCanCloseEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object;
TOnAcceleratorEvent = procedure(const Sender: TObject; const window: ICefWindow; command_id: Integer; var aResult : boolean) of object;
TOnWindowKeyEventEvent = procedure(const Sender: TObject; const window: ICefWindow; const event: TCefKeyEvent; var aResult : boolean) of object;
TOnWindowCreatedEvent = procedure(const Sender: TObject; const window: ICefWindow) of object;
TOnWindowDestroyedEvent = procedure(const Sender: TObject; const window: ICefWindow) of object;
TOnGetParentWindowEvent = procedure(const Sender: TObject; const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow) of object;
TOnGetInitialBoundsEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : TCefRect) of object;
TOnGetInitialShowStateEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : TCefShowState) of object;
TOnIsFramelessEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object;
TOnCanResizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object;
TOnCanMaximizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object;
TOnCanMinimizeEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object;
TOnCanCloseEvent = procedure(const Sender: TObject; const window: ICefWindow; var aResult : boolean) of object;
TOnAcceleratorEvent = procedure(const Sender: TObject; const window: ICefWindow; command_id: Integer; var aResult : boolean) of object;
TOnWindowKeyEventEvent = procedure(const Sender: TObject; const window: ICefWindow; const event: TCefKeyEvent; var aResult : boolean) of object;
implementation

View File

@ -83,6 +83,7 @@ type
function GetWindowIcon : ICefImage;
procedure SetWindowAppIcon(const image: ICefImage);
function GetWindowAppIcon : ICefImage;
function AddOverlayView(const view: ICefView; docking_mode: TCefDockingMode): ICefOverlayController;
procedure ShowMenu(const menu_model: ICefMenuModel; const screen_point: TCefPoint; anchor_position : TCefMenuAnchorPosition);
procedure CancelMenu;
function GetDisplay : ICefDisplay;
@ -104,7 +105,7 @@ type
implementation
uses
uCEFLibFunctions, uCEFMiscFunctions, uCEFImage, uCEFDisplay;
uCEFLibFunctions, uCEFMiscFunctions, uCEFImage, uCEFDisplay, uCEFOverlayController;
procedure TCefWindowRef.Show;
begin
@ -229,6 +230,13 @@ begin
Result := TCefImageRef.UnWrap(PCefWindow(FData)^.get_window_app_icon(PCefWindow(FData)));
end;
function TCefWindowRef.AddOverlayView(const view: ICefView; docking_mode: TCefDockingMode): ICefOverlayController;
begin
Result := TCefOverlayControllerRef.UnWrap(PCefWindow(FData)^.add_overlay_view(PCefWindow(FData),
CefGetData(view),
docking_mode));
end;
procedure TCefWindowRef.ShowMenu(const menu_model : ICefMenuModel;
const screen_point : TCefPoint;
anchor_position : TCefMenuAnchorPosition);

View File

@ -71,6 +71,7 @@ type
FOnWindowDestroyed : TOnWindowDestroyedEvent;
FOnGetParentWindow : TOnGetParentWindowEvent;
FOnGetInitialBounds : TOnGetInitialBoundsEvent;
FOnGetInitialShowState : TOnGetInitialShowStateEvent;
FOnIsFrameless : TOnIsFramelessEvent;
FOnCanResize : TOnCanResizeEvent;
FOnCanMaximize : TOnCanMaximizeEvent;
@ -110,6 +111,7 @@ type
procedure doOnWindowDestroyed(const window_: ICefWindow);
procedure doOnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
procedure doOnGetInitialBounds(const window_: ICefWindow; var aResult : TCefRect);
procedure doOnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState);
procedure doOnIsFrameless(const window_: ICefWindow; var aResult : boolean);
procedure doOnCanResize(const window_: ICefWindow; var aResult : boolean);
procedure doOnCanMaximize(const window_: ICefWindow; var aResult : boolean);
@ -133,6 +135,7 @@ type
procedure Maximize;
procedure Minimize;
procedure Restore;
function AddOverlayView(const view: ICefView; docking_mode: TCefDockingMode): ICefOverlayController;
procedure ShowMenu(const menu_model: ICefMenuModel; const screen_point: TCefPoint; anchor_position : TCefMenuAnchorPosition);
procedure CancelMenu;
procedure SetDraggableRegions(regionsCount: NativeUInt; const regions: PCefDraggableRegionArray);
@ -157,17 +160,18 @@ type
property IsMinimized : boolean read GetIsMinimized;
published
property OnWindowCreated : TOnWindowCreatedEvent read FOnWindowCreated write FOnWindowCreated;
property OnWindowDestroyed : TOnWindowDestroyedEvent read FOnWindowDestroyed write FOnWindowDestroyed;
property OnGetParentWindow : TOnGetParentWindowEvent read FOnGetParentWindow write FOnGetParentWindow;
property OnGetInitialBounds : TOnGetInitialBoundsEvent read FOnGetInitialBounds write FOnGetInitialBounds;
property OnIsFrameless : TOnIsFramelessEvent read FOnIsFrameless write FOnIsFrameless;
property OnCanResize : TOnCanResizeEvent read FOnCanResize write FOnCanResize;
property OnCanMaximize : TOnCanMaximizeEvent read FOnCanMaximize write FOnCanMaximize;
property OnCanMinimize : TOnCanMinimizeEvent read FOnCanMinimize write FOnCanMinimize;
property OnCanClose : TOnCanCloseEvent read FOnCanClose write FOnCanClose;
property OnAccelerator : TOnAcceleratorEvent read FOnAccelerator write FOnAccelerator;
property OnKeyEvent : TOnWindowKeyEventEvent read FOnKeyEvent write FOnKeyEvent;
property OnWindowCreated : TOnWindowCreatedEvent read FOnWindowCreated write FOnWindowCreated;
property OnWindowDestroyed : TOnWindowDestroyedEvent read FOnWindowDestroyed write FOnWindowDestroyed;
property OnGetParentWindow : TOnGetParentWindowEvent read FOnGetParentWindow write FOnGetParentWindow;
property OnGetInitialBounds : TOnGetInitialBoundsEvent read FOnGetInitialBounds write FOnGetInitialBounds;
property OnGetInitialShowState : TOnGetInitialShowStateEvent read FOnGetInitialShowState write FOnGetInitialShowState;
property OnIsFrameless : TOnIsFramelessEvent read FOnIsFrameless write FOnIsFrameless;
property OnCanResize : TOnCanResizeEvent read FOnCanResize write FOnCanResize;
property OnCanMaximize : TOnCanMaximizeEvent read FOnCanMaximize write FOnCanMaximize;
property OnCanMinimize : TOnCanMinimizeEvent read FOnCanMinimize write FOnCanMinimize;
property OnCanClose : TOnCanCloseEvent read FOnCanClose write FOnCanClose;
property OnAccelerator : TOnAcceleratorEvent read FOnAccelerator write FOnAccelerator;
property OnKeyEvent : TOnWindowKeyEventEvent read FOnKeyEvent write FOnKeyEvent;
end;
{$IFDEF FPC}
@ -216,6 +220,7 @@ begin
FOnWindowDestroyed := nil;
FOnGetParentWindow := nil;
FOnGetInitialBounds := nil;
FOnGetInitialShowState := nil;
FOnIsFrameless := nil;
FOnCanResize := nil;
FOnCanMaximize := nil;
@ -307,6 +312,12 @@ begin
FOnGetInitialBounds(self, window_, aResult);
end;
procedure TCEFWindowComponent.doOnGetInitialShowState(const window_: ICefWindow; var aResult : TCefShowState);
begin
if assigned(FOnGetInitialShowState) then
FOnGetInitialShowState(self, window_, aResult);
end;
procedure TCEFWindowComponent.doOnIsFrameless(const window_: ICefWindow; var aResult : boolean);
begin
if assigned(FOnIsFrameless) then
@ -478,6 +489,14 @@ begin
Result := nil;
end;
function TCEFWindowComponent.AddOverlayView(const view: ICefView; docking_mode: TCefDockingMode): ICefOverlayController;
begin
if Initialized then
Result := FWindow.AddOverlayView(view, docking_mode)
else
Result := nil;
end;
procedure TCEFWindowComponent.ShowMenu(const menu_model: ICefMenuModel; const screen_point: TCefPoint; anchor_position : TCefMenuAnchorPosition);
begin
if Initialized then FWindow.ShowMenu(menu_model, screen_point, anchor_position);

View File

@ -63,6 +63,7 @@ type
procedure OnWindowDestroyed(const window: ICefWindow);
procedure OnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
procedure OnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect);
procedure OnGetInitialShowState(const window: ICefWindow; var aResult : TCefShowState);
procedure OnIsFrameless(const window: ICefWindow; var aResult : boolean);
procedure OnCanResize(const window: ICefWindow; var aResult : boolean);
procedure OnCanMaximize(const window: ICefWindow; var aResult : boolean);
@ -81,6 +82,7 @@ type
procedure OnWindowDestroyed(const window: ICefWindow); virtual;
procedure OnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); virtual;
procedure OnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect); virtual;
procedure OnGetInitialShowState(const window: ICefWindow; var aResult : TCefShowState); virtual;
procedure OnIsFrameless(const window: ICefWindow; var aResult : boolean); virtual;
procedure OnCanResize(const window: ICefWindow; var aResult : boolean); virtual;
procedure OnCanMaximize(const window: ICefWindow; var aResult : boolean); virtual;
@ -107,6 +109,7 @@ type
procedure OnParentViewChanged(const view: ICefView; added: boolean; const parent: ICefView); override;
procedure OnChildViewChanged(const view: ICefView; added: boolean; const child: ICefView); override;
procedure OnWindowChanged(const view: ICefView; added: boolean); override;
procedure OnLayoutChanged(const view: ICefView; new_bounds: TCefRect); override;
procedure OnFocus(const view: ICefView); override;
procedure OnBlur(const view: ICefView); override;
@ -115,6 +118,7 @@ type
procedure OnWindowDestroyed(const window: ICefWindow); override;
procedure OnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow); override;
procedure OnGetInitialBounds(const window: ICefWindow; var aResult : TCefRect); override;
procedure OnGetInitialShowState(const window: ICefWindow; var aResult : TCefShowState); override;
procedure OnIsFrameless(const window: ICefWindow; var aResult : boolean); override;
procedure OnCanResize(const window: ICefWindow; var aResult : boolean); override;
procedure OnCanMaximize(const window: ICefWindow; var aResult : boolean); override;
@ -130,7 +134,7 @@ type
implementation
uses
uCEFLibFunctions, uCEFMiscFunctions, uCEFWindow;
uCEFLibFunctions, uCEFMiscFunctions, uCEFWindow, uCEFConstants;
// **************************************************************
@ -169,6 +173,11 @@ begin
aResult := PCefWindowDelegate(FData)^.get_initial_bounds(PCefWindowDelegate(FData), CefGetData(window));
end;
procedure TCefWindowDelegateRef.OnGetInitialShowState(const window: ICefWindow; var aResult : TCefShowState);
begin
aResult := PCefWindowDelegate(FData)^.get_initial_show_state(PCefWindowDelegate(FData), CefGetData(window));
end;
procedure TCefWindowDelegateRef.OnIsFrameless(const window: ICefWindow; var aResult : boolean);
begin
aResult := (PCefWindowDelegate(FData)^.is_frameless(PCefWindowDelegate(FData), CefGetData(window)) <> 0);
@ -286,6 +295,18 @@ begin
Result.height := TempRect.height;
end;
function cef_window_delegate_get_initial_show_state(self: PCefWindowDelegate; window: PCefWindow): TCefShowState; stdcall;
var
TempObject : TObject;
begin
TempObject := CefGetObject(self);
Result := CEF_SHOW_STATE_NORMAL;
if (TempObject <> nil) and (TempObject is TCefWindowDelegateOwn) then
TCefWindowDelegateOwn(TempObject).OnGetInitialShowState(TCefWindowRef.UnWrap(window),
Result);
end;
function cef_window_delegate_is_frameless(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall;
var
TempObject : TObject;
@ -405,6 +426,7 @@ begin
on_window_destroyed := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_destroyed;
get_parent_window := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_get_parent_window;
get_initial_bounds := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_get_initial_bounds;
get_initial_show_state := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_get_initial_show_state;
is_frameless := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_is_frameless;
can_resize := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_can_resize;
can_maximize := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_can_maximize;
@ -435,6 +457,11 @@ begin
//
end;
procedure TCefWindowDelegateOwn.OnGetInitialShowState(const window: ICefWindow; var aResult : TCefShowState);
begin
//
end;
procedure TCefWindowDelegateOwn.OnIsFrameless(const window: ICefWindow; var aResult : boolean);
begin
//
@ -559,6 +586,17 @@ begin
end;
end;
procedure TCustomWindowDelegate.OnLayoutChanged(const view: ICefView; new_bounds: TCefRect);
begin
try
if (FEvents <> nil) then
ICefWindowDelegateEvents(FEvents).doOnLayoutChanged(view, new_bounds);
except
on e : exception do
if CustomExceptionHandler('TCustomWindowDelegate.OnLayoutChanged', e) then raise;
end;
end;
procedure TCustomWindowDelegate.OnFocus(const view: ICefView);
begin
try
@ -625,6 +663,17 @@ begin
end;
end;
procedure TCustomWindowDelegate.OnGetInitialShowState(const window: ICefWindow; var aResult : TCefShowState);
begin
try
if (FEvents <> nil) then
ICefWindowDelegateEvents(FEvents).doOnGetInitialShowState(window, aResult);
except
on e : exception do
if CustomExceptionHandler('TCustomWindowDelegate.OnGetInitialShowState', e) then raise;
end;
end;
procedure TCustomWindowDelegate.OnIsFrameless(const window: ICefWindow; var aResult : boolean);
begin
try

View File

@ -2,9 +2,9 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 321,
"InternalVersion" : 322,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "93.1.14.0"
"Version" : "94.4.1.0"
}
],
"UpdatePackageData" : {