1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +02:00

Update to CEF 112.3.0

This commit is contained in:
salvadordf
2023-04-21 16:05:10 +02:00
parent 94fff08cc8
commit 000f162de2
9 changed files with 137 additions and 85 deletions

View File

@@ -3039,6 +3039,7 @@ type
procedure OnCanClose(const window_: ICefWindow; var aResult : boolean);
procedure OnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean);
procedure OnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean);
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
end;
ICefWindowDelegateEvents = interface(ICefPanelDelegateEvents)
@@ -3060,6 +3061,7 @@ type
procedure doOnCanClose(const window_: ICefWindow; var aResult : boolean);
procedure doOnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean);
procedure doOnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean);
procedure doOnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
end;
implementation

View File

@@ -3552,6 +3552,7 @@ type
can_close : function(self: PCefWindowDelegate; window: PCefWindow): Integer; stdcall;
on_accelerator : function(self: PCefWindowDelegate; window: PCefWindow; command_id: Integer): Integer; stdcall;
on_key_event : function(self: PCefWindowDelegate; window: PCefWindow; const event: PCefKeyEvent): Integer; stdcall;
on_window_fullscreen_transition : procedure(self: PCefWindowDelegate; window: PCefWindow; is_completed: integer); stdcall;
end;
implementation

View File

@@ -1,9 +1,9 @@
CEF_SUPPORTED_VERSION_MAJOR = 112;
CEF_SUPPORTED_VERSION_MINOR = 2;
CEF_SUPPORTED_VERSION_RELEASE = 10;
CEF_SUPPORTED_VERSION_MINOR = 3;
CEF_SUPPORTED_VERSION_RELEASE = 0;
CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = CEF_SUPPORTED_VERSION_MAJOR;
CEF_CHROMEELF_VERSION_MINOR = 0;
CEF_CHROMEELF_VERSION_RELEASE = 5615;
CEF_CHROMEELF_VERSION_BUILD = 121;
CEF_CHROMEELF_VERSION_BUILD = 165;

View File

@@ -90,23 +90,24 @@ 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;
TOnWindowClosingEvent = procedure(const Sender: TObject; const window_: ICefWindow) of object;
TOnWindowDestroyedEvent = procedure(const Sender: TObject; const window_: ICefWindow) of object;
TOnWindowActivationChangedEvent = procedure(const Sender: TObject; const window_: ICefWindow; active: boolean) of object;
TOnWindowBoundsChangedEvent = procedure(const Sender: TObject; const window_: ICefWindow; const new_bounds: TCefRect) 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;
TOnWithStandardWindowButtonsEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object;
TOnGetTitlebarHeightEvent = procedure(const Sender: TObject; const window_: ICefWindow; var titlebar_height: Single; 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;
TOnWindowClosingEvent = procedure(const Sender: TObject; const window_: ICefWindow) of object;
TOnWindowDestroyedEvent = procedure(const Sender: TObject; const window_: ICefWindow) of object;
TOnWindowActivationChangedEvent = procedure(const Sender: TObject; const window_: ICefWindow; active: boolean) of object;
TOnWindowBoundsChangedEvent = procedure(const Sender: TObject; const window_: ICefWindow; const new_bounds: TCefRect) 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;
TOnWithStandardWindowButtonsEvent = procedure(const Sender: TObject; const window_: ICefWindow; var aResult : boolean) of object;
TOnGetTitlebarHeightEvent = procedure(const Sender: TObject; const window_: ICefWindow; var titlebar_height: Single; 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;
TOnWindowFullscreenTransitionEvent = procedure(const Sender: TObject; const window_: ICefWindow; is_completed: boolean) of object;
implementation

View File

@@ -63,27 +63,28 @@ type
{$IFNDEF FPC}{$IFDEF DELPHI16_UP}[ComponentPlatformsAttribute(pfidWindows or pfidOSX or pfidLinux)]{$ENDIF}{$ENDIF}
TCEFWindowComponent = class(TCEFPanelComponent, ICefWindowDelegateEvents)
protected
FWindow : ICefWindow;
FWindowDlg : ICefWindowDelegate;
FWindow : ICefWindow;
FWindowDlg : ICefWindowDelegate;
// ICefWindowDelegateEvents
FOnWindowCreated : TOnWindowCreatedEvent;
FOnWindowClosing : TOnWindowClosingEvent;
FOnWindowDestroyed : TOnWindowDestroyedEvent;
FOnWindowActivationChanged : TOnWindowActivationChangedEvent;
FOnWindowBoundsChanged : TOnWindowBoundsChangedEvent;
FOnGetParentWindow : TOnGetParentWindowEvent;
FOnGetInitialBounds : TOnGetInitialBoundsEvent;
FOnGetInitialShowState : TOnGetInitialShowStateEvent;
FOnIsFrameless : TOnIsFramelessEvent;
FOnWithStandardWindowButtons : TOnWithStandardWindowButtonsEvent;
FOnGetTitlebarHeight : TOnGetTitlebarHeightEvent;
FOnCanResize : TOnCanResizeEvent;
FOnCanMaximize : TOnCanMaximizeEvent;
FOnCanMinimize : TOnCanMinimizeEvent;
FOnCanClose : TOnCanCloseEvent;
FOnAccelerator : TOnAcceleratorEvent;
FOnKeyEvent : TOnWindowKeyEventEvent;
FOnWindowCreated : TOnWindowCreatedEvent;
FOnWindowClosing : TOnWindowClosingEvent;
FOnWindowDestroyed : TOnWindowDestroyedEvent;
FOnWindowActivationChanged : TOnWindowActivationChangedEvent;
FOnWindowBoundsChanged : TOnWindowBoundsChangedEvent;
FOnGetParentWindow : TOnGetParentWindowEvent;
FOnGetInitialBounds : TOnGetInitialBoundsEvent;
FOnGetInitialShowState : TOnGetInitialShowStateEvent;
FOnIsFrameless : TOnIsFramelessEvent;
FOnWithStandardWindowButtons : TOnWithStandardWindowButtonsEvent;
FOnGetTitlebarHeight : TOnGetTitlebarHeightEvent;
FOnCanResize : TOnCanResizeEvent;
FOnCanMaximize : TOnCanMaximizeEvent;
FOnCanMinimize : TOnCanMinimizeEvent;
FOnCanClose : TOnCanCloseEvent;
FOnAccelerator : TOnAcceleratorEvent;
FOnKeyEvent : TOnWindowKeyEventEvent;
FOnWindowFullscreenTransition : TOnWindowFullscreenTransitionEvent;
procedure DestroyView; override;
procedure Initialize; override;
@@ -129,6 +130,7 @@ type
procedure doOnCanClose(const window_: ICefWindow; var aResult : boolean);
procedure doOnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean);
procedure doOnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean);
procedure doOnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
// ICefViewDelegateEvents
procedure doCreateCustomView; override;
@@ -170,23 +172,24 @@ type
property IsMinimized : boolean read GetIsMinimized;
published
property OnWindowCreated : TOnWindowCreatedEvent read FOnWindowCreated write FOnWindowCreated;
property OnWindowClosing : TOnWindowClosingEvent read FOnWindowClosing write FOnWindowClosing;
property OnWindowDestroyed : TOnWindowDestroyedEvent read FOnWindowDestroyed write FOnWindowDestroyed;
property OnWindowActivationChanged : TOnWindowActivationChangedEvent read FOnWindowActivationChanged write FOnWindowActivationChanged;
property OnWindowBoundsChanged : TOnWindowBoundsChangedEvent read FOnWindowBoundsChanged write FOnWindowBoundsChanged;
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 OnWithStandardWindowButtons : TOnWithStandardWindowButtonsEvent read FOnWithStandardWindowButtons write FOnWithStandardWindowButtons;
property OnGetTitlebarHeight : TOnGetTitlebarHeightEvent read FOnGetTitlebarHeight write FOnGetTitlebarHeight;
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 OnWindowClosing : TOnWindowClosingEvent read FOnWindowClosing write FOnWindowClosing;
property OnWindowDestroyed : TOnWindowDestroyedEvent read FOnWindowDestroyed write FOnWindowDestroyed;
property OnWindowActivationChanged : TOnWindowActivationChangedEvent read FOnWindowActivationChanged write FOnWindowActivationChanged;
property OnWindowBoundsChanged : TOnWindowBoundsChangedEvent read FOnWindowBoundsChanged write FOnWindowBoundsChanged;
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 OnWithStandardWindowButtons : TOnWithStandardWindowButtonsEvent read FOnWithStandardWindowButtons write FOnWithStandardWindowButtons;
property OnGetTitlebarHeight : TOnGetTitlebarHeightEvent read FOnGetTitlebarHeight write FOnGetTitlebarHeight;
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 OnWindowFullscreenTransition : TOnWindowFullscreenTransitionEvent read FOnWindowFullscreenTransition write FOnWindowFullscreenTransition;
end;
{$IFDEF FPC}
@@ -229,25 +232,26 @@ procedure TCEFWindowComponent.Initialize;
begin
inherited Initialize;
FWindow := nil;
FWindowDlg := nil;
FOnWindowCreated := nil;
FOnWindowClosing := nil;
FOnWindowDestroyed := nil;
FOnWindowActivationChanged := nil;
FOnWindowBoundsChanged := nil;
FOnGetParentWindow := nil;
FOnGetInitialBounds := nil;
FOnGetInitialShowState := nil;
FOnIsFrameless := nil;
FOnWithStandardWindowButtons := nil;
FOnGetTitlebarHeight := nil;
FOnCanResize := nil;
FOnCanMaximize := nil;
FOnCanMinimize := nil;
FOnCanClose := nil;
FOnAccelerator := nil;
FOnKeyEvent := nil;
FWindow := nil;
FWindowDlg := nil;
FOnWindowCreated := nil;
FOnWindowClosing := nil;
FOnWindowDestroyed := nil;
FOnWindowActivationChanged := nil;
FOnWindowBoundsChanged := nil;
FOnGetParentWindow := nil;
FOnGetInitialBounds := nil;
FOnGetInitialShowState := nil;
FOnIsFrameless := nil;
FOnWithStandardWindowButtons := nil;
FOnGetTitlebarHeight := nil;
FOnCanResize := nil;
FOnCanMaximize := nil;
FOnCanMinimize := nil;
FOnCanClose := nil;
FOnAccelerator := nil;
FOnKeyEvent := nil;
FOnWindowFullscreenTransition := nil;
end;
procedure TCEFWindowComponent.CreateTopLevelWindow;
@@ -410,6 +414,12 @@ begin
FOnKeyEvent(self, window_, event, aResult);
end;
procedure TCEFWindowComponent.doOnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
begin
if assigned(FOnWindowFullscreenTransition) then
FOnWindowFullscreenTransition(self, window_, is_completed);
end;
procedure TCEFWindowComponent.Show;
begin
if Initialized then FWindow.Show;

View File

@@ -76,6 +76,7 @@ type
procedure OnCanClose(const window_: ICefWindow; var aResult : boolean);
procedure OnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean);
procedure OnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean);
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
public
class function UnWrap(data: Pointer): ICefWindowDelegate;
@@ -100,6 +101,7 @@ type
procedure OnCanClose(const window_: ICefWindow; var aResult : boolean); virtual;
procedure OnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean); virtual;
procedure OnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean); virtual;
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean); virtual;
procedure InitializeCEFMethods; override;
@@ -141,6 +143,7 @@ type
procedure OnCanClose(const window_: ICefWindow; var aResult : boolean); override;
procedure OnAccelerator(const window_: ICefWindow; command_id: Integer; var aResult : boolean); override;
procedure OnKeyEvent(const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean); override;
procedure OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean); override;
public
constructor Create(const events: ICefWindowDelegateEvents); reintroduce;
@@ -253,6 +256,11 @@ begin
aResult := (PCefWindowDelegate(FData)^.on_key_event(PCefWindowDelegate(FData), CefGetData(window_), @event) <> 0);
end;
procedure TCefWindowDelegateRef.OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
begin
PCefWindowDelegate(FData)^.on_window_fullscreen_transition(PCefWindowDelegate(FData), CefGetData(window_), ord(is_completed));
end;
class function TCefWindowDelegateRef.UnWrap(data: Pointer): ICefWindowDelegate;
begin
if (data <> nil) then
@@ -460,6 +468,19 @@ begin
Result := ord(TempResult);
end;
procedure cef_window_delegate_on_window_fullscreen_transition(self : PCefWindowDelegate;
window_ : PCefWindow;
is_completed : integer); stdcall;
var
TempObject : TObject;
begin
TempObject := CefGetObject(self);
if (TempObject <> nil) and (TempObject is TCefWindowDelegateOwn) then
TCefWindowDelegateOwn(TempObject).OnWindowFullscreenTransition(TCefWindowRef.UnWrap(window_),
is_completed <> 0);
end;
constructor TCefWindowDelegateOwn.Create;
begin
inherited CreateData(SizeOf(TCefWindowDelegate));
@@ -486,6 +507,7 @@ begin
can_close := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_can_close;
on_accelerator := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_accelerator;
on_key_event := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_key_event;
on_window_fullscreen_transition := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_fullscreen_transition;
end;
end;
@@ -574,6 +596,11 @@ begin
//
end;
procedure TCefWindowDelegateOwn.OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
begin
//
end;
// **************************************************************
// ******************* TCustomWindowDelegate ********************
@@ -883,6 +910,17 @@ begin
end;
end;
procedure TCustomWindowDelegate.OnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean);
begin
try
if (FEvents <> nil) then
ICefWindowDelegateEvents(FEvents).doOnWindowFullscreenTransition(window_, is_completed);
except
on e : exception do
if CustomExceptionHandler('TCustomWindowDelegate.OnWindowFullscreenTransition', e) then raise;
end;
end;
end.