1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2024-11-24 08:02:15 +02:00

Update to CEF 113.3.1

This commit is contained in:
salvadordf 2023-05-29 17:20:32 +02:00
parent 42d8ba4f85
commit 9e7da7a03e
11 changed files with 101 additions and 40 deletions

View File

@ -3,15 +3,14 @@ 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 113.1.5 which includes Chromium 113.0.5672.93.
CEF4Delphi uses CEF 113.3.1 which includes Chromium 113.0.5672.128.
The CEF binaries used by CEF4Delphi are available for download at Spotify :
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_113.1.5%2Bge452d82%2Bchromium-113.0.5672.93_windows32.tar.bz2)
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_113.1.5%2Bge452d82%2Bchromium-113.0.5672.93_windows64.tar.bz2)
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_113.1.5%2Bge452d82%2Bchromium-113.0.5672.93_linux64.tar.bz2)
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_113.1.5%2Bge452d82%2Bchromium-113.0.5672.93_linuxarm.tar.bz2)
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_113.1.5%2Bge452d82%2Bchromium-113.0.5672.93_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_113.1.5%2Bge452d82%2Bchromium-113.0.5672.93_macosx64.tar.bz2)
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_113.3.1%2Bg525fa10%2Bchromium-113.0.5672.128_windows32.tar.bz2)
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_113.3.1%2Bg525fa10%2Bchromium-113.0.5672.128_windows64.tar.bz2)
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_113.3.1%2Bg525fa10%2Bchromium-113.0.5672.128_linux64.tar.bz2)
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_113.3.1%2Bg525fa10%2Bchromium-113.0.5672.128_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_113.3.1%2Bg525fa10%2Bchromium-113.0.5672.128_macosx64.tar.bz2)
CEF4Delphi was developed and tested on Delphi 11.3 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3, Delphi 10.4 and Lazarus 2.2.6/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.

View File

@ -21,7 +21,7 @@
</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="113" Minor="1" Release="5"/>
<Version Major="113" Minor="3" Release="1"/>
<Files Count="214">
<Item1>
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>

View File

@ -72,6 +72,7 @@ type
FOnGetDelegateForPopupBrowserView : TOnGetDelegateForPopupBrowserViewEvent;
FOnPopupBrowserViewCreated : TOnPopupBrowserViewCreatedEvent;
FOnGetChromeToolbarType : TOnGetChromeToolbarTypeEvent;
FOnGestureCommand : TOnGestureCommandEvent;
procedure DestroyView; override;
procedure Initialize; override;
@ -87,6 +88,7 @@ type
procedure doOnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
procedure doOnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
procedure doOnGetChromeToolbarType(var aChromeToolbarType: TCefChromeToolbarType);
procedure doOnGestureCommand(const browser_view: ICefBrowserView; gesture_command: TCefGestureCommand; var aResult : boolean);
public
function CreateBrowserView(const client: ICefClient; const url: ustring; const settings: TCefBrowserSettings; const extra_info: ICefDictionaryValue; const request_context: ICefRequestContext): boolean;
@ -102,6 +104,7 @@ type
property OnGetDelegateForPopupBrowserView : TOnGetDelegateForPopupBrowserViewEvent read FOnGetDelegateForPopupBrowserView write FOnGetDelegateForPopupBrowserView;
property OnPopupBrowserViewCreated : TOnPopupBrowserViewCreatedEvent read FOnPopupBrowserViewCreated write FOnPopupBrowserViewCreated;
property OnGetChromeToolbarType : TOnGetChromeToolbarTypeEvent read FOnGetChromeToolbarType write FOnGetChromeToolbarType;
property OnGestureCommand : TOnGestureCommandEvent read FOnGestureCommand write FOnGestureCommand;
end;
{$IFDEF FPC}
@ -151,6 +154,7 @@ begin
FOnGetDelegateForPopupBrowserView := nil;
FOnPopupBrowserViewCreated := nil;
FOnGetChromeToolbarType := nil;
FOnGestureCommand := nil;
end;
procedure TCEFBrowserViewComponent.DestroyView;
@ -260,6 +264,14 @@ begin
FOnGetChromeToolbarType(self, aChromeToolbarType);
end;
procedure TCEFBrowserViewComponent.doOnGestureCommand(const browser_view : ICefBrowserView;
gesture_command : TCefGestureCommand;
var aResult : boolean);
begin
if assigned(FOnGestureCommand) then
FOnGestureCommand(self, browser_view, aResult);
end;
{$IFDEF FPC}
procedure Register;
begin

View File

@ -64,6 +64,7 @@ type
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
function GetChromeToolbarType: TCefChromeToolbarType;
procedure OnGestureCommand(const browser_view: ICefBrowserView; gesture_command: TCefGestureCommand; var aResult : boolean);
public
class function UnWrap(data: Pointer): ICefBrowserViewDelegate;
@ -76,6 +77,7 @@ type
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate); virtual;
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean); virtual;
function GetChromeToolbarType: TCefChromeToolbarType; virtual;
procedure OnGestureCommand(const browser_view: ICefBrowserView; gesture_command: TCefGestureCommand; var aResult : boolean); virtual;
procedure InitializeCEFMethods; override;
@ -105,6 +107,7 @@ type
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate); override;
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean); override;
function GetChromeToolbarType: TCefChromeToolbarType; override;
procedure OnGestureCommand(const browser_view: ICefBrowserView; gesture_command: TCefGestureCommand; var aResult : boolean); override;
public
constructor Create(const events: ICefBrowserViewDelegateEvents); reintroduce;
@ -165,6 +168,15 @@ begin
Result := PCefBrowserViewDelegate(FData)^.get_chrome_toolbar_type(PCefBrowserViewDelegate(FData));
end;
procedure TCefBrowserViewDelegateRef.OnGestureCommand(const browser_view : ICefBrowserView;
gesture_command : TCefGestureCommand;
var aResult : boolean);
begin
aResult := (PCefBrowserViewDelegate(FData)^.on_gesture_command(PCefBrowserViewDelegate(FData),
CefGetData(browser_view),
gesture_command) <> 0);
end;
class function TCefBrowserViewDelegateRef.UnWrap(data: Pointer): ICefBrowserViewDelegate;
begin
if (data <> nil) then
@ -257,6 +269,24 @@ begin
Result := TCefBrowserViewDelegateOwn(TempObject).GetChromeToolbarType();
end;
function cef_browserview_delegate_on_gesture_command(self : PCefBrowserViewDelegate;
browser_view : PCefBrowserView;
gesture_command : TCefGestureCommand): Integer; stdcall;
var
TempObject : TObject;
TempResult : boolean;
begin
TempObject := CefGetObject(self);
TempResult := False;
if (TempObject <> nil) and (TempObject is TCefBrowserViewDelegateOwn) then
TCefBrowserViewDelegateOwn(TempObject).OnGestureCommand(TCefBrowserViewRef.UnWrap(browser_view),
gesture_command,
TempResult);
Result := ord(TempResult);
end;
constructor TCefBrowserViewDelegateOwn.Create;
begin
inherited CreateData(SizeOf(TCefBrowserViewDelegate));
@ -275,6 +305,7 @@ begin
get_delegate_for_popup_browser_view := {$IFDEF FPC}@{$ENDIF}cef_browserview_delegate_get_delegate_for_popup_browser_view;
on_popup_browser_view_created := {$IFDEF FPC}@{$ENDIF}cef_browserview_delegate_on_popup_browser_view_created;
get_chrome_toolbar_type := {$IFDEF FPC}@{$ENDIF}cef_browserview_delegate_get_chrome_toolbar_type;
on_gesture_command := {$IFDEF FPC}@{$ENDIF}cef_browserview_delegate_on_gesture_command;
end;
end;
@ -303,6 +334,11 @@ begin
Result := CEF_CTT_NONE;
end;
procedure TCefBrowserViewDelegateOwn.OnGestureCommand(const browser_view: ICefBrowserView; gesture_command: TCefGestureCommand; var aResult : boolean);
begin
//
end;
// **************************************************************
// **************** TCustomBrowserViewDelegate ******************
@ -482,5 +518,18 @@ begin
end;
end;
procedure TCustomBrowserViewDelegate.OnGestureCommand(const browser_view : ICefBrowserView;
gesture_command : TCefGestureCommand;
var aResult : boolean);
begin
try
if (FEvents <> nil) then
ICefBrowserViewDelegateEvents(FEvents).doOnGestureCommand(browser_view, gesture_command, aResult);
except
on e : exception do
if CustomExceptionHandler('TCustomBrowserViewDelegate.OnGestureCommand', e) then raise;
end;
end;
end.

View File

@ -769,16 +769,7 @@ end;
procedure TBufferPanel.WMIMEComposition(var aMessage: TMessage);
const
// CEF uses UINT32_MAX to initialize the TCefRange parameters.
// FPC works fine with a high(integer) value but if we try to use
// integer(high(cardinal)) then it duplicates the result string.
// Delphi however works fine with integer(high(cardinal)) but it doesn't show
// any result string when we use high(integer)
{$IFDEF FPC}
UINT32_MAX = high(integer);
{$ELSE}
UINT32_MAX = integer(high(cardinal));
{$ENDIF}
UINT32_MAX = high(cardinal);
var
TempText : ustring;
TempRange : TCefRange;

View File

@ -2882,6 +2882,7 @@ type
procedure OnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
procedure OnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
function GetChromeToolbarType: TCefChromeToolbarType;
procedure OnGestureCommand(const browser_view: ICefBrowserView; gesture_command: TCefGestureCommand; var aResult : boolean);
property ChromeToolbarType: TCefChromeToolbarType read GetChromeToolbarType;
end;
@ -2893,6 +2894,7 @@ type
procedure doOnGetDelegateForPopupBrowserView(const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate);
procedure doOnPopupBrowserViewCreated(const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean);
procedure doOnGetChromeToolbarType(var aChromeToolbarType: TCefChromeToolbarType);
procedure doOnGestureCommand(const browser_view: ICefBrowserView; gesture_command: TCefGestureCommand; var aResult : boolean);
end;
// TCefButton

View File

@ -77,7 +77,7 @@ type
protected
FHWND : HWND;
FCompositionRange : TCefRange;
FCursorIndex : integer;
FCursorIndex : cardinal;
FIMERect : TCefRect;
FSystemCaret : boolean;
FInputLanguageID : LANGID;
@ -94,8 +94,8 @@ type
{$IFDEF MSWINDOWS}
function IsSelectionAttribute(aAttribute : AnsiChar) : boolean;
{$ENDIF}
procedure GetCompositionSelectionRange(imc : HIMC; var target_start, target_end : integer);
procedure GetCompositionUnderlines(imc : HIMC; target_start, target_end : integer; var underlines : TCefCompositionUnderlineDynArray);
procedure GetCompositionSelectionRange(imc : HIMC; var target_start, target_end : cardinal);
procedure GetCompositionUnderlines(imc : HIMC; target_start, target_end : cardinal; var underlines : TCefCompositionUnderlineDynArray);
public
constructor Create(aHWND : HWND);
@ -113,7 +113,7 @@ type
procedure EnableIME;
procedure DisableIME;
procedure CancelIME;
procedure UpdateCaretPosition(index : integer);
procedure UpdateCaretPosition(index : cardinal);
procedure ChangeCompositionRange(const selection_range : TCefRange; const character_bounds : TCefRectDynArray);
procedure MoveImeWindow;
@ -148,7 +148,7 @@ begin
FHWND := aHWND;
FCompositionRange.from := 0;
FCompositionRange.to_ := 0;
FCursorIndex := -1;
FCursorIndex := high(cardinal);
FIMERect.x := -1;
FIMERect.y := -1;
FIMERect.width := 0;
@ -215,7 +215,8 @@ procedure TCEFOSRIMEHandler.GetCompositionInfo( imc : HIMC;
var underlines : TCefCompositionUnderlineDynArray;
var composition_start : integer);
var
TempTargetStart, TempTargetEnd, TempLen, i : integer;
TempLen, TempTargetStart, TempTargetEnd : cardinal;
i : integer;
begin
if (underlines <> nil) then
begin
@ -337,7 +338,7 @@ begin
end;
{$ENDIF}
procedure TCEFOSRIMEHandler.GetCompositionSelectionRange(imc : HIMC; var target_start, target_end : integer);
procedure TCEFOSRIMEHandler.GetCompositionSelectionRange(imc : HIMC; var target_start, target_end : cardinal);
{$IFDEF MSWINDOWS}
var
i, TempStart, TempEnd, TempBufferLen : integer;
@ -389,8 +390,8 @@ begin
end;
procedure TCEFOSRIMEHandler.GetCompositionUnderlines( imc : HIMC;
target_start : integer;
target_end : integer;
target_start : cardinal;
target_end : cardinal;
var underlines : TCefCompositionUnderlineDynArray);
{$IFDEF MSWINDOWS}
var
@ -528,7 +529,7 @@ end;
procedure TCEFOSRIMEHandler.ResetComposition;
begin
FIsComposing := False;
FCursorIndex := -1;
FCursorIndex := high(cardinal);
end;
function TCEFOSRIMEHandler.GetResult(aParam : LPARAM; var aResult : ustring) : boolean;
@ -627,7 +628,7 @@ begin
end;
end;
procedure TCEFOSRIMEHandler.UpdateCaretPosition(index : integer);
procedure TCEFOSRIMEHandler.UpdateCaretPosition(index : cardinal);
begin
FCursorIndex := index;
MoveImeWindow();
@ -664,7 +665,7 @@ procedure TCEFOSRIMEHandler.MoveImeWindow;
{$IFDEF MSWINDOWS}
var
TempRect : TCefRect;
TempLocation : integer;
TempLocation : cardinal;
TempIMC : HIMC;
TempCandidatePos : TCandidateForm;
TempCandidateExc : TCandidateForm;
@ -678,7 +679,7 @@ begin
TempRect := FIMERect;
TempLocation := FCursorIndex;
if (TempLocation = -1) then
if (TempLocation = high(cardinal)) then
TempLocation := FCompositionRange.from;
if (TempLocation >= FCompositionRange.from) then
@ -687,8 +688,7 @@ begin
if (FCompositionBounds = nil) then
exit
else
if (TempLocation >= 0) and
(TempLocation < length(FCompositionBounds)) then
if (TempLocation < cardinal(length(FCompositionBounds))) then
TempRect := FCompositionBounds[TempLocation]
else
if (length(FCompositionBounds) > 0) then

View File

@ -565,8 +565,8 @@ type
// /include/internal/cef_types_geometry.h (cef_range_t)
TCefRange = record
from : Integer;
to_ : Integer;
from : cardinal;
to_ : cardinal;
end;
TCefRangeArray = array of TCefRange;
@ -1197,6 +1197,12 @@ type
CEF_PREFERENCES_TYPE_REQUEST_CONTEXT
);
// /include/internal/cef_types.h (cef_gesture_command_t)
TCefGestureCommand = (
CEF_GESTURE_COMMAND_BACK,
CEF_GESTURE_COMMAND_FORWARD
);
// /include/internal/cef_types.h (cef_test_cert_type_t)
TCefTestCertType = (
CEF_TEST_CERT_OK_IP,
@ -3436,6 +3442,7 @@ type
get_delegate_for_popup_browser_view : function(self: PCefBrowserViewDelegate; browser_view: PCefBrowserView; const settings: PCefBrowserSettings; client: PCefClient; is_devtools: Integer): PCefBrowserViewDelegate; stdcall;
on_popup_browser_view_created : function(self: PCefBrowserViewDelegate; browser_view, popup_browser_view: PCefBrowserView; is_devtools: Integer): Integer; stdcall;
get_chrome_toolbar_type : function(self: PCefBrowserViewDelegate): TCefChromeToolbarType; stdcall;
on_gesture_command : function(self: PCefBrowserViewDelegate; browser_view: PCefBrowserView; gesture_command: TCefGestureCommand): Integer; stdcall;
end;
// /include/capi/views/cef_button_capi.h (cef_button_t)

View File

@ -1,9 +1,9 @@
CEF_SUPPORTED_VERSION_MAJOR = 113;
CEF_SUPPORTED_VERSION_MINOR = 1;
CEF_SUPPORTED_VERSION_RELEASE = 5;
CEF_SUPPORTED_VERSION_MINOR = 3;
CEF_SUPPORTED_VERSION_RELEASE = 1;
CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = CEF_SUPPORTED_VERSION_MAJOR;
CEF_CHROMEELF_VERSION_MINOR = 0;
CEF_CHROMEELF_VERSION_RELEASE = 5672;
CEF_CHROMEELF_VERSION_BUILD = 93;
CEF_CHROMEELF_VERSION_BUILD = 128;

View File

@ -81,6 +81,7 @@ type
TOnGetDelegateForPopupBrowserViewEvent = procedure(const Sender: TObject; const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean; var aResult : ICefBrowserViewDelegate) of object;
TOnPopupBrowserViewCreatedEvent = procedure(const Sender: TObject; const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean; var aResult : boolean) of object;
TOnGetChromeToolbarTypeEvent = procedure(const Sender: TObject; var aChromeToolbarType: TCefChromeToolbarType) of object;
TOnGestureCommandEvent = procedure(const Sender: TObject; const browser_view: ICefBrowserView; var aResult : boolean) of object;
// ICefButtonDelegate
TOnButtonPressedEvent = procedure(const Sender: TObject; const button: ICefButton) of object;

View File

@ -2,9 +2,9 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 486,
"InternalVersion" : 487,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "113.1.5"
"Version" : "113.3.1"
}
],
"UpdatePackageData" : {