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

Update to CEF 102.0.8

This commit is contained in:
salvadordf
2022-05-26 13:08:20 +02:00
parent 959d152d9c
commit 5bbddf099c
21 changed files with 181 additions and 167 deletions

View File

@ -3,18 +3,18 @@ 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 101.0.18 which includes Chromium 101.0.4951.67.
CEF4Delphi uses CEF 102.0.8 which includes Chromium 102.0.5005.61.
The CEF binaries used by CEF4Delphi are available for download at Spotify :
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.18%2Bg367b4a0%2Bchromium-101.0.4951.67_windows32.tar.bz2)
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.18%2Bg367b4a0%2Bchromium-101.0.4951.67_windows64.tar.bz2)
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.18%2Bg367b4a0%2Bchromium-101.0.4951.67_linux32.tar.bz2)
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.18%2Bg367b4a0%2Bchromium-101.0.4951.67_linux64.tar.bz2)
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.18%2Bg367b4a0%2Bchromium-101.0.4951.67_linuxarm.tar.bz2)
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.18%2Bg367b4a0%2Bchromium-101.0.4951.67_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_101.0.18%2Bg367b4a0%2Bchromium-101.0.4951.67_macosx64.tar.bz2)
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_102.0.8%2Bg60bd108%2Bchromium-102.0.5005.61_windows32.tar.bz2)
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_102.0.8%2Bg60bd108%2Bchromium-102.0.5005.61_windows64.tar.bz2)
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_102.0.8%2Bg60bd108%2Bchromium-102.0.5005.61_linux32.tar.bz2)
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_102.0.8%2Bg60bd108%2Bchromium-102.0.5005.61_linux64.tar.bz2)
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_102.0.8%2Bg60bd108%2Bchromium-102.0.5005.61_linuxarm.tar.bz2)
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_102.0.8%2Bg60bd108%2Bchromium-102.0.5005.61_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_102.0.8%2Bg60bd108%2Bchromium-102.0.5005.61_macosx64.tar.bz2)
CEF4Delphi was developed and tested on Delphi 11.1 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.0/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
CEF4Delphi was developed and tested on Delphi 11.1 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.2/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
CEF4Delphi demos have been tested in Windows 7, Windows 10, Windows 11, Linux Mint 20.3 and Raspberry Pi OS.

View File

@ -184,7 +184,7 @@ type
procedure Chromium1CookiesFlushed(Sender: TObject);
procedure Chromium1ZoomPctAvailable(Sender: TObject; const aZoomPct: Double);
procedure Chromium1DevToolsMethodResult(Sender: TObject; const browser: ICefBrowser; message_id: Integer; success: Boolean; const result: ICefValue);
procedure Chromium1FileDialog(Sender: TObject; const browser: ICefBrowser; mode: Cardinal; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback; out Result: Boolean);
procedure Chromium1FileDialog(Sender: TObject; const browser: ICefBrowser; mode: Cardinal; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: ICefFileDialogCallback; var Result: Boolean);
procedure Chromium1SelectClientCertificate(Sender: TObject; const browser: ICefBrowser; isProxy: Boolean; const host: ustring; port: Integer; certificatesCount: NativeUInt; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback; var aResult: Boolean);
procedure Chromium1CursorChange(Sender: TObject; const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult: Boolean);
procedure Chromium1CanDownload(Sender: TObject; const browser: ICefBrowser; const url, request_method: ustring; var aResult: Boolean);
@ -313,6 +313,7 @@ begin
GlobalCEFApp.EnableGPU := True;
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
//GlobalCEFApp.ChromeRuntime := True;
end;
procedure TMiniBrowserFrm.BackBtnClick(Sender: TObject);
@ -663,16 +664,14 @@ procedure TMiniBrowserFrm.Chromium1FileDialog( Sender : TOb
const title : ustring;
const defaultFilePath : ustring;
const acceptFilters : TStrings;
selectedAcceptFilter : Integer;
const callback : ICefFileDialogCallback;
out Result : Boolean);
var Result : Boolean);
begin
Result := True;
FFileDialogInfo.Mode := mode;
FFileDialogInfo.Title := title;
FFileDialogInfo.DefaultFilePath := defaultFilePath;
FFileDialogInfo.SelectedAcceptFilter := selectedAcceptFilter;
FFileDialogInfo.Callback := callback;
FFileDialogInfo.AcceptFilters := acceptFilters;
@ -691,12 +690,9 @@ begin
TempDialog.Title := FFileDialogInfo.Title;
TempDialog.InitialDir := FFileDialogInfo.DefaultFilePath;
TempDialog.Filter := FFileDialogInfo.DialogFilter;
TempDialog.FilterIndex := FFileDialogInfo.SelectedAcceptFilter;
TempOptions := TempDialog.Options;
if aMultiple then include(TempOptions, ofAllowMultiSelect);
if FFileDialogInfo.OverwritePrompt then include(TempOptions, ofOverwritePrompt);
if FFileDialogInfo.HideReadOnly then include(TempOptions, ofHideReadOnly);
if aMultiple then include(TempOptions, ofAllowMultiSelect);
TempDialog.Options := TempOptions;
@ -707,8 +703,6 @@ begin
else
aFilePaths.Add(TempDialog.FileName);
FFileDialogInfo.SelectedAcceptFilter := TempDialog.FilterIndex;
Result := True;
end;
@ -745,14 +739,10 @@ begin
TempDialog := TSaveDialog.Create(Application.MainForm);
TempDialog.Title := FFileDialogInfo.Title;
TempDialog.Filter := FFileDialogInfo.DialogFilter;
TempDialog.FilterIndex := FFileDialogInfo.SelectedAcceptFilter;
TempDialog.FileName := ExtractFileName(FFileDialogInfo.DefaultFilePath);
TempDialog.InitialDir := ExtractFileDir(FFileDialogInfo.DefaultFilePath);
TempOptions := TempDialog.Options;
if FFileDialogInfo.OverwritePrompt then include(TempOptions, ofOverwritePrompt);
if FFileDialogInfo.HideReadOnly then include(TempOptions, ofHideReadOnly);
TempDialog.Options := TempOptions;
if TempDialog.Execute(Handle) and
@ -781,7 +771,7 @@ begin
end;
if TempResult then
FFileDialogInfo.Callback.Cont(FFileDialogInfo.SelectedAcceptFilter, TempFilePaths)
FFileDialogInfo.Callback.Cont(TempFilePaths)
else
FFileDialogInfo.Callback.Cancel;
@ -1266,6 +1256,10 @@ begin
// if TChromium.MultiBrowserMode is enabled then we have to close all
// stored browsers and not only the main browser.
Chromium1.CloseAllBrowsers;
// Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
if GlobalCEFApp.ChromeRuntime then
CEFWindowParent1.Free;
end;
end;

View File

@ -78,6 +78,9 @@
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -61,6 +61,9 @@
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

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="101" Release="18"/>
<Version Major="102" Release="8"/>
<Files Count="202">
<Item1>
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>

View File

@ -66,15 +66,15 @@ uses
uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar;
const
CEF_SUPPORTED_VERSION_MAJOR = 101;
CEF_SUPPORTED_VERSION_MAJOR = 102;
CEF_SUPPORTED_VERSION_MINOR = 0;
CEF_SUPPORTED_VERSION_RELEASE = 18;
CEF_SUPPORTED_VERSION_RELEASE = 8;
CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 101;
CEF_CHROMEELF_VERSION_MINOR = 0;
CEF_CHROMEELF_VERSION_RELEASE = 4951;
CEF_CHROMEELF_VERSION_BUILD = 67;
CEF_CHROMEELF_VERSION_RELEASE = 5005;
CEF_CHROMEELF_VERSION_BUILD = 61;
{$IFDEF MSWINDOWS}
LIBCEF_DLL = 'libcef.dll';

View File

@ -97,8 +97,8 @@ type
function GetRequestContext: ICefRequestContext;
function GetZoomLevel: Double;
procedure SetZoomLevel(const zoomLevel: Double);
procedure RunFileDialog(mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefRunFileDialogCallback);
procedure RunFileDialogProc(mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: TCefRunFileDialogCallbackProc);
procedure RunFileDialog(mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: ICefRunFileDialogCallback);
procedure RunFileDialogProc(mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: TCefRunFileDialogCallbackProc);
procedure StartDownload(const url: ustring);
procedure DownloadImage(const imageUrl: ustring; isFavicon: Boolean; maxImageSize: Cardinal; bypassCache: Boolean; const callback: ICefDownloadImageCallback);
procedure DownloadImageProc(const imageUrl: ustring; isFavicon: Boolean; maxImageSize: Cardinal; bypassCache: Boolean; const callback: TOnDownloadImageFinishedProc);
@ -458,7 +458,6 @@ procedure TCefBrowserHostRef.RunFileDialog( mode : TCefFile
const title : ustring;
const defaultFilePath : ustring;
const acceptFilters : TStrings;
selectedAcceptFilter : Integer;
const callback : ICefRunFileDialogCallback);
var
TempTitle, TempPath : TCefString;
@ -476,7 +475,6 @@ begin
@TempTitle,
@TempPath,
TempAcceptFilters.Handle,
selectedAcceptFilter,
CefGetData(callback));
finally
TempAcceptFilters := nil;
@ -487,10 +485,9 @@ procedure TCefBrowserHostRef.RunFileDialogProc( mode : TCef
const title : ustring;
const defaultFilePath : ustring;
const acceptFilters : TStrings;
selectedAcceptFilter : Integer;
const callback : TCefRunFileDialogCallbackProc);
begin
RunFileDialog(mode, title, defaultFilePath, acceptFilters, selectedAcceptFilter, TCefFastRunFileDialogCallback.Create(callback));
RunFileDialog(mode, title, defaultFilePath, acceptFilters, TCefFastRunFileDialogCallback.Create(callback));
end;
procedure TCefBrowserHostRef.AddWordToDictionary(const word: ustring);

View File

@ -580,7 +580,7 @@ type
function doCanSaveCookie(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; const cookie: PCefCookie): boolean; virtual;
// ICefDialogHandler
function doOnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean; virtual;
function doOnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: ICefFileDialogCallback): Boolean; virtual;
// ICefRenderHandler
procedure doOnGetAccessibilityHandler(var aAccessibilityHandler : ICefAccessibilityHandler); virtual;
@ -5499,14 +5499,12 @@ function TChromiumCore.doOnFileDialog(const browser : ICefBrowser;
const title : ustring;
const defaultFilePath : ustring;
const acceptFilters : TStrings;
selectedAcceptFilter : Integer;
const callback : ICefFileDialogCallback): Boolean;
begin
Result := False;
if assigned(FOnFileDialog) then
FOnFileDialog(Self, browser, mode, title, defaultFilePath, acceptFilters,
selectedAcceptFilter, callback, Result);
FOnFileDialog(Self, browser, mode, title, defaultFilePath, acceptFilters, callback, Result);
end;
procedure TChromiumCore.doOnFindResult(const browser : ICefBrowser;

View File

@ -136,7 +136,7 @@ type
TOnCanSaveCookie = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; const cookie: PCefCookie; var aResult : boolean) of object;
// ICefDialogHandler
TOnFileDialog = procedure(Sender: TObject; const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback; out Result: Boolean) of Object;
TOnFileDialog = procedure(Sender: TObject; const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: ICefFileDialogCallback; var Result: Boolean) of Object;
// ICefRenderHandler
TOnGetAccessibilityHandler = procedure(Sender: TObject; var aAccessibilityHandler : ICefAccessibilityHandler) of Object;

View File

@ -475,9 +475,6 @@ const
FILE_DIALOG_OPEN_MULTIPLE = $00000001;
FILE_DIALOG_OPEN_FOLDER = $00000002;
FILE_DIALOG_SAVE = $00000003;
FILE_DIALOG_TYPE_MASK = $000000FF;
FILE_DIALOG_OVERWRITEPROMPT_FLAG = $01000000;
FILE_DIALOG_HIDEREADONLY_FLAG = $02000000;
// /include/internal/cef_types.h (cef_uri_unescape_rule_t)
UU_NONE = 0;

View File

@ -59,7 +59,7 @@ uses
type
TCefDialogHandlerOwn = class(TCefBaseRefCountedOwn, ICefDialogHandler)
protected
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean; virtual;
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: ICefFileDialogCallback): Boolean; virtual;
procedure RemoveReferences; virtual;
@ -71,7 +71,7 @@ type
protected
FEvents : Pointer;
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title: ustring; const defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean; override;
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title: ustring; const defaultFilePath: ustring; const acceptFilters: TStrings; const callback: ICefFileDialogCallback): Boolean; override;
procedure RemoveReferences; override;
@ -96,7 +96,6 @@ function cef_dialog_handler_on_file_dialog(self : PCefDialogH
const title : PCefString;
const default_file_path : PCefString;
accept_filters : TCefStringList;
selected_accept_filter : Integer;
callback : PCefFileDialogCallback): Integer; stdcall;
var
TempSL : TStringList;
@ -121,7 +120,6 @@ begin
CefString(title),
CefString(default_file_path),
TempSL,
selected_accept_filter,
TCefFileDialogCallbackRef.UnWrap(callback)));
end;
except
@ -145,7 +143,6 @@ function TCefDialogHandlerOwn.OnFileDialog(const browser : ICefBr
const title : ustring;
const defaultFilePath : ustring;
const acceptFilters : TStrings;
selectedAcceptFilter : Integer;
const callback : ICefFileDialogCallback): Boolean;
begin
Result := False;
@ -182,15 +179,14 @@ function TCustomDialogHandler.OnFileDialog(const browser : ICefBrow
const title : ustring;
const defaultFilePath : ustring;
const acceptFilters : TStrings;
selectedAcceptFilter : Integer;
const callback : ICefFileDialogCallback): Boolean;
begin
if (FEvents <> nil) then
Result := IChromiumEvents(FEvents).doOnFileDialog(browser, mode, title, defaultFilePath,
acceptFilters, selectedAcceptFilter, callback)
acceptFilters, callback)
else
Result := inherited OnFileDialog(browser, mode, title, defaultFilePath,
acceptFilters, selectedAcceptFilter, callback);
acceptFilters, callback);
end;
end.

View File

@ -59,7 +59,7 @@ uses
type
TCefFileDialogCallbackRef = class(TCefBaseRefCountedRef, ICefFileDialogCallback)
protected
procedure Cont(selectedAcceptFilter: Integer; const filePaths: TStrings);
procedure Cont(const filePaths: TStrings);
procedure Cancel;
public
class function UnWrap(data: Pointer): ICefFileDialogCallback;
@ -75,7 +75,7 @@ begin
PCefFileDialogCallback(FData)^.cancel(FData);
end;
procedure TCefFileDialogCallbackRef.Cont(selectedAcceptFilter: Integer; const filePaths: TStrings);
procedure TCefFileDialogCallbackRef.Cont(const filePaths: TStrings);
var
TempSL : ICefStringList;
begin
@ -84,7 +84,6 @@ begin
TempSL.AddStrings(filePaths);
PCefFileDialogCallback(FData)^.cont(PCefFileDialogCallback(FData),
selectedAcceptFilter,
TempSL.Handle);
finally
TempSL := nil;

View File

@ -63,7 +63,6 @@ type
FTitle : ustring;
FDefaultFilePath : ustring;
FAcceptFilters : TStrings;
FSelectedAcceptFilter : Integer;
FCallback : ICefFileDialogCallback;
FDefaultAudioFileDesc : ustring;
FDefaultVideoFileDesc : ustring;
@ -72,8 +71,6 @@ type
FDefaultAllFileDesc : ustring;
FDefaultUnknownFileDesc : ustring;
function GetOverwritePrompt : boolean;
function GetHideReadonly : boolean;
function GetDialogFilter : ustring; virtual;
function GetDialogType : TCEFDialogType;
@ -91,10 +88,7 @@ type
property Title : ustring read FTitle write FTitle;
property DefaultFilePath : ustring read FDefaultFilePath write FDefaultFilePath;
property AcceptFilters : TStrings write SetAcceptFilters;
property SelectedAcceptFilter : Integer read FSelectedAcceptFilter write FSelectedAcceptFilter;
property Callback : ICefFileDialogCallback read FCallback write FCallback;
property OverwritePrompt : boolean read GetOverwritePrompt;
property HideReadonly : boolean read GetHideReadonly;
property DialogFilter : ustring read GetDialogFilter;
property DialogType : TCEFDialogType read GetDialogType;
property DefaultAudioFileDesc : ustring read FDefaultAudioFileDesc write FDefaultAudioFileDesc;
@ -117,7 +111,6 @@ begin
FMode := 0;
FTitle := '';
FDefaultFilePath := '';
FSelectedAcceptFilter := 0;
FCallback := nil;
FAcceptFilters := nil;
FDefaultAudioFileDesc := 'Audio files';
@ -143,26 +136,15 @@ begin
FMode := 0;
FTitle := '';
FDefaultFilePath := '';
FSelectedAcceptFilter := 0;
FCallback := nil;
if assigned(FAcceptFilters) then
FAcceptFilters.Clear;
end;
function TCEFFileDialogInfo.GetOverwritePrompt : boolean;
begin
Result := ((FMode and FILE_DIALOG_OVERWRITEPROMPT_FLAG) <> 0);
end;
function TCEFFileDialogInfo.GetHideReadonly : boolean;
begin
Result := ((FMode and FILE_DIALOG_HIDEREADONLY_FLAG) <> 0);
end;
function TCEFFileDialogInfo.GetDialogType : TCEFDialogType;
begin
case (FMode and FILE_DIALOG_TYPE_MASK) of
case FMode of
FILE_DIALOG_OPEN : Result := dtOpen;
FILE_DIALOG_OPEN_MULTIPLE : Result := dtOpenMultiple;
FILE_DIALOG_OPEN_FOLDER : Result := dtOpenFolder;

View File

@ -241,7 +241,7 @@ type
TCefDomVisitorProc2 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument);
TCefDomVisitorProc3 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument; const aValue : ustring);
TCefStringVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const str: ustring);
TCefRunFileDialogCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(selectedAcceptFilter: Integer; const filePaths: TStrings);
TCefRunFileDialogCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const filePaths: TStrings);
TCefCompletionCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure();
TCefSetCookieCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(success: Boolean);
TCefDeleteCookiesCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(numDeleted: Integer);
@ -389,7 +389,7 @@ type
function doCanSaveCookie(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; const cookie: PCefCookie): boolean;
// ICefDialogHandler
function doOnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean;
function doOnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: ICefFileDialogCallback): Boolean;
// ICefRenderHandler
procedure doOnGetAccessibilityHandler(var aAccessibilityHandler : ICefAccessibilityHandler);
@ -562,7 +562,7 @@ type
// /include/capi/cef_browser_capi.h (cef_run_file_dialog_callback_t)
ICefRunFileDialogCallback = interface(ICefBaseRefCounted)
['{59FCECC6-E897-45BA-873B-F09586C4BE47}']
procedure OnFileDialogDismissed(selectedAcceptFilter: Integer; const filePaths: TStrings);
procedure OnFileDialogDismissed(const filePaths: TStrings);
end;
// TCefNavigationEntryVisitor
@ -600,8 +600,8 @@ type
function GetRequestContext: ICefRequestContext;
function GetZoomLevel: Double;
procedure SetZoomLevel(const zoomLevel: Double);
procedure RunFileDialog(mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefRunFileDialogCallback);
procedure RunFileDialogProc(mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: TCefRunFileDialogCallbackProc);
procedure RunFileDialog(mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: ICefRunFileDialogCallback);
procedure RunFileDialogProc(mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: TCefRunFileDialogCallbackProc);
procedure StartDownload(const url: ustring);
procedure DownloadImage(const imageUrl: ustring; isFavicon: Boolean; maxImageSize: cardinal; bypassCache: Boolean; const callback: ICefDownloadImageCallback);
procedure Print;
@ -2050,7 +2050,7 @@ type
// /include/capi/cef_dialog_handler_capi.h (cef_dialog_handler_t)
ICefDialogHandler = interface(ICefBaseRefCounted)
['{7763F4B2-8BE1-4E80-AC43-8B825850DC67}']
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean;
function OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: ICefFileDialogCallback): Boolean;
procedure RemoveReferences; // custom procedure to clear all references
end;
@ -2146,7 +2146,7 @@ type
// /include/capi/cef_dialog_handler_capi.h (cef_file_dialog_callback_t)
ICefFileDialogCallback = interface(ICefBaseRefCounted)
['{1AF659AB-4522-4E39-9C52-184000D8E3C7}']
procedure Cont(selectedAcceptFilter: Integer; const filePaths: TStrings);
procedure Cont(const filePaths: TStrings);
procedure Cancel;
end;
@ -2944,6 +2944,7 @@ type
['{52D4EE2C-303B-42B6-A35F-30D03834A23F}']
procedure OnWindowCreated(const window: ICefWindow);
procedure OnWindowDestroyed(const window: ICefWindow);
procedure OnWindowActivationChanged(const window: ICefWindow; active: boolean);
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);
@ -2960,6 +2961,7 @@ type
['{05C19A41-E75D-459E-AD4D-C8A0CA4A49D3}']
procedure doOnWindowCreated(const window: ICefWindow);
procedure doOnWindowDestroyed(const window: ICefWindow);
procedure doOnWindowActivationChanged(const window: ICefWindow; active: boolean);
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);

View File

@ -1266,8 +1266,6 @@ begin
TempList.Add(TempDir + 'vulkan-1.dll');
TempList.Add(TempDir + 'libEGL.dll');
TempList.Add(TempDir + 'libGLESv2.dll');
TempList.Add(TempDir + 'swiftshader\libEGL.dll');
TempList.Add(TempDir + 'swiftshader\libGLESv2.dll');
{$ENDIF}
{$IFDEF LINUX}
TempList.Add(TempDir + 'libEGL.so');
@ -1275,8 +1273,6 @@ begin
TempList.Add(TempDir + 'libvk_swiftshader.so');
TempList.Add(TempDir + 'vk_swiftshader_icd.json');
TempList.Add(TempDir + 'libvulkan.so.1');
TempList.Add(TempDir + 'swiftshader/libEGL.so');
TempList.Add(TempDir + 'swiftshader/libGLESv2.so');
{$ENDIF}
TempList.Add(TempDir + 'icudtl.dat');

View File

@ -59,7 +59,7 @@ uses
type
TCefRunFileDialogCallbackOwn = class(TCefBaseRefCountedOwn, ICefRunFileDialogCallback)
protected
procedure OnFileDialogDismissed(selectedAcceptFilter: Integer; const filePaths: TStrings); virtual;
procedure OnFileDialogDismissed(const filePaths: TStrings); virtual;
public
constructor Create;
@ -69,7 +69,7 @@ type
protected
FCallback: TCefRunFileDialogCallbackProc;
procedure OnFileDialogDismissed(selectedAcceptFilter: Integer; const filePaths: TStrings); override;
procedure OnFileDialogDismissed(const filePaths: TStrings); override;
public
constructor Create(callback: TCefRunFileDialogCallbackProc); reintroduce; virtual;
@ -80,9 +80,8 @@ implementation
uses
uCEFTypes, uCEFMiscFunctions, uCEFLibFunctions, uCEFStringList;
procedure cef_run_file_dialog_callback_on_file_dialog_dismissed(self : PCefRunFileDialogCallback;
selected_accept_filter : Integer;
file_paths : TCefStringList); stdcall;
procedure cef_run_file_dialog_callback_on_file_dialog_dismissed(self : PCefRunFileDialogCallback;
file_paths : TCefStringList); stdcall;
var
TempSL : TStringList;
TempCefSL : ICefStringList;
@ -99,7 +98,7 @@ begin
TempCefSL := TCefStringListRef.Create(file_paths);
TempCefSL.CopyToStrings(TempSL);
TCefRunFileDialogCallbackOwn(TempObject).OnFileDialogDismissed(selected_accept_filter, TempSL);
TCefRunFileDialogCallbackOwn(TempObject).OnFileDialogDismissed(TempSL);
end;
except
on e : exception do
@ -116,20 +115,19 @@ constructor TCefRunFileDialogCallbackOwn.Create;
begin
inherited CreateData(SizeOf(TCefRunFileDialogCallback));
with PCefRunFileDialogCallback(FData)^ do
on_file_dialog_dismissed := {$IFDEF FPC}@{$ENDIF}cef_run_file_dialog_callback_on_file_dialog_dismissed;
PCefRunFileDialogCallback(FData)^.on_file_dialog_dismissed := {$IFDEF FPC}@{$ENDIF}cef_run_file_dialog_callback_on_file_dialog_dismissed;
end;
procedure TCefRunFileDialogCallbackOwn.OnFileDialogDismissed(selectedAcceptFilter: Integer; const filePaths: TStrings);
procedure TCefRunFileDialogCallbackOwn.OnFileDialogDismissed(const filePaths: TStrings);
begin
//
//
end;
// TCefFastRunFileDialogCallback
procedure TCefFastRunFileDialogCallback.OnFileDialogDismissed(selectedAcceptFilter: Integer; const filePaths: TStrings);
procedure TCefFastRunFileDialogCallback.OnFileDialogDismissed(const filePaths: TStrings);
begin
FCallback(selectedAcceptFilter, filePaths);
FCallback(filePaths);
end;
constructor TCefFastRunFileDialogCallback.Create(callback: TCefRunFileDialogCallbackProc);

View File

@ -821,7 +821,8 @@ type
CEF_CHANNEL_LAYOUT_DISCRETE,
CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC,
CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE,
CEF_CHANNEL_LAYOUT_BITSTREAM // CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_BITSTREAM
CEF_CHANNEL_LAYOUT_BITSTREAM,
CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX // CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX
);
// /include/internal/cef_types.h (cef_cookie_same_site_t)
@ -1520,14 +1521,14 @@ type
// /include/capi/cef_dialog_handler_capi.h (cef_file_dialog_callback_t)
TCefFileDialogCallback = record
base : TCefBaseRefCounted;
cont : procedure(self: PCefFileDialogCallback; selected_accept_filter: Integer; file_paths: TCefStringList); stdcall;
cont : procedure(self: PCefFileDialogCallback; file_paths: TCefStringList); stdcall;
cancel : procedure(self: PCefFileDialogCallback); stdcall;
end;
// /include/capi/cef_dialog_handler_capi.h (cef_dialog_handler_t)
TCefDialogHandler = record
base : TCefBaseRefCounted;
on_file_dialog : function(self: PCefDialogHandler; browser: PCefBrowser; mode: TCefFileDialogMode; const title, default_file_path: PCefString; accept_filters: TCefStringList; selected_accept_filter: Integer; callback: PCefFileDialogCallback): Integer; stdcall;
on_file_dialog : function(self: PCefDialogHandler; browser: PCefBrowser; mode: TCefFileDialogMode; const title, default_file_path: PCefString; accept_filters: TCefStringList; callback: PCefFileDialogCallback): Integer; stdcall;
end;
// /include/capi/cef_display_handler_capi.h (cef_display_handler_t)
@ -2144,7 +2145,7 @@ type
// /include/capi/cef_browser_capi.h (cef_run_file_dialog_callback_t)
TCefRunFileDialogCallback = record
base : TCefBaseRefCounted;
on_file_dialog_dismissed : procedure(self: PCefRunFileDialogCallback; selected_accept_filter: Integer; file_paths: TCefStringList); stdcall;
on_file_dialog_dismissed : procedure(self: PCefRunFileDialogCallback; file_paths: TCefStringList); stdcall;
end;
// /include/capi/cef_browser_capi.h (cef_download_image_callback_t)
@ -2867,7 +2868,7 @@ type
get_request_context : function(self: PCefBrowserHost): PCefRequestContext; stdcall;
get_zoom_level : function(self: PCefBrowserHost): Double; stdcall;
set_zoom_level : procedure(self: PCefBrowserHost; zoomLevel: Double); stdcall;
run_file_dialog : procedure(self: PCefBrowserHost; mode: TCefFileDialogMode; const title, default_file_path: PCefString; accept_filters: TCefStringList; selected_accept_filter: Integer; callback: PCefRunFileDialogCallback); stdcall;
run_file_dialog : procedure(self: PCefBrowserHost; mode: TCefFileDialogMode; const title, default_file_path: PCefString; accept_filters: TCefStringList; callback: PCefRunFileDialogCallback); stdcall;
start_download : procedure(self: PCefBrowserHost; const url: PCefString); stdcall;
download_image : procedure(self: PCefBrowserHost; const image_url: PCefString; is_favicon: Integer; max_image_size: Cardinal; bypass_cache: Integer; callback: PCefDownloadImageCallback); stdcall;
print : procedure(self: PCefBrowserHost); stdcall;
@ -3360,6 +3361,7 @@ type
base : TCefPanelDelegate;
on_window_created : procedure(self: PCefWindowDelegate; window: PCefWindow); stdcall;
on_window_destroyed : procedure(self: PCefWindowDelegate; window: PCefWindow); stdcall;
on_window_activation_changed : procedure(self: PCefWindowDelegate; window: PCefWindow; active: integer); 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;

View File

@ -90,18 +90,19 @@ 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;
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;
TOnWindowCreatedEvent = 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;
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

@ -63,22 +63,23 @@ type
{$IFNDEF FPC}{$IFDEF DELPHI16_UP}[ComponentPlatformsAttribute(pidWin32 or pidWin64)]{$ENDIF}{$ENDIF}
TCEFWindowComponent = class(TCEFPanelComponent, ICefWindowDelegateEvents)
protected
FWindow : ICefWindow;
FWindowDlg : ICefWindowDelegate;
FWindow : ICefWindow;
FWindowDlg : ICefWindowDelegate;
// ICefWindowDelegateEvents
FOnWindowCreated : TOnWindowCreatedEvent;
FOnWindowDestroyed : TOnWindowDestroyedEvent;
FOnGetParentWindow : TOnGetParentWindowEvent;
FOnGetInitialBounds : TOnGetInitialBoundsEvent;
FOnGetInitialShowState : TOnGetInitialShowStateEvent;
FOnIsFrameless : TOnIsFramelessEvent;
FOnCanResize : TOnCanResizeEvent;
FOnCanMaximize : TOnCanMaximizeEvent;
FOnCanMinimize : TOnCanMinimizeEvent;
FOnCanClose : TOnCanCloseEvent;
FOnAccelerator : TOnAcceleratorEvent;
FOnKeyEvent : TOnWindowKeyEventEvent;
FOnWindowCreated : TOnWindowCreatedEvent;
FOnWindowDestroyed : TOnWindowDestroyedEvent;
FOnWindowActivationChanged : TOnWindowActivationChangedEvent;
FOnGetParentWindow : TOnGetParentWindowEvent;
FOnGetInitialBounds : TOnGetInitialBoundsEvent;
FOnGetInitialShowState : TOnGetInitialShowStateEvent;
FOnIsFrameless : TOnIsFramelessEvent;
FOnCanResize : TOnCanResizeEvent;
FOnCanMaximize : TOnCanMaximizeEvent;
FOnCanMinimize : TOnCanMinimizeEvent;
FOnCanClose : TOnCanCloseEvent;
FOnAccelerator : TOnAcceleratorEvent;
FOnKeyEvent : TOnWindowKeyEventEvent;
procedure DestroyView; override;
procedure Initialize; override;
@ -109,6 +110,7 @@ type
// ICefWindowDelegateEvents
procedure doOnWindowCreated(const window_: ICefWindow);
procedure doOnWindowDestroyed(const window_: ICefWindow);
procedure doOnWindowActivationChanged(const window_: ICefWindow; active: boolean);
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);
@ -160,18 +162,19 @@ 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 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;
property OnWindowCreated : TOnWindowCreatedEvent read FOnWindowCreated write FOnWindowCreated;
property OnWindowDestroyed : TOnWindowDestroyedEvent read FOnWindowDestroyed write FOnWindowDestroyed;
property OnWindowActivationChanged : TOnWindowActivationChangedEvent read FOnWindowActivationChanged write FOnWindowActivationChanged;
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}
@ -214,20 +217,21 @@ procedure TCEFWindowComponent.Initialize;
begin
inherited Initialize;
FWindow := nil;
FWindowDlg := nil;
FOnWindowCreated := nil;
FOnWindowDestroyed := nil;
FOnGetParentWindow := nil;
FOnGetInitialBounds := nil;
FOnGetInitialShowState := nil;
FOnIsFrameless := nil;
FOnCanResize := nil;
FOnCanMaximize := nil;
FOnCanMinimize := nil;
FOnCanClose := nil;
FOnAccelerator := nil;
FOnKeyEvent := nil;
FWindow := nil;
FWindowDlg := nil;
FOnWindowCreated := nil;
FOnWindowDestroyed := nil;
FOnWindowActivationChanged := nil;
FOnGetParentWindow := nil;
FOnGetInitialBounds := nil;
FOnGetInitialShowState := nil;
FOnIsFrameless := nil;
FOnCanResize := nil;
FOnCanMaximize := nil;
FOnCanMinimize := nil;
FOnCanClose := nil;
FOnAccelerator := nil;
FOnKeyEvent := nil;
end;
procedure TCEFWindowComponent.CreateTopLevelWindow;
@ -300,6 +304,12 @@ begin
FWindow := nil;
end;
procedure TCEFWindowComponent.doOnWindowActivationChanged(const window_: ICefWindow; active: boolean);
begin
if assigned(FOnWindowActivationChanged) then
FOnWindowActivationChanged(self, window_, active);
end;
procedure TCEFWindowComponent.doOnGetParentWindow(const window_: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
begin
if assigned(FOnGetParentWindow) then

View File

@ -61,6 +61,7 @@ type
protected
procedure OnWindowCreated(const window: ICefWindow);
procedure OnWindowDestroyed(const window: ICefWindow);
procedure OnWindowActivationChanged(const window: ICefWindow; active: boolean);
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);
@ -80,6 +81,7 @@ type
protected
procedure OnWindowCreated(const window: ICefWindow); virtual;
procedure OnWindowDestroyed(const window: ICefWindow); virtual;
procedure OnWindowActivationChanged(const window: ICefWindow; active: boolean); 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;
@ -116,6 +118,7 @@ type
// ICefWindowDelegate
procedure OnWindowCreated(const window: ICefWindow); override;
procedure OnWindowDestroyed(const window: ICefWindow); override;
procedure OnWindowActivationChanged(const window: ICefWindow; active: boolean); 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;
@ -151,6 +154,11 @@ begin
PCefWindowDelegate(FData)^.on_window_destroyed(PCefWindowDelegate(FData), CefGetData(window));
end;
procedure TCefWindowDelegateRef.OnWindowActivationChanged(const window: ICefWindow; active: boolean);
begin
PCefWindowDelegate(FData)^.on_window_activation_changed(PCefWindowDelegate(FData), CefGetData(window), ord(active));
end;
procedure TCefWindowDelegateRef.OnGetParentWindow(const window : ICefWindow;
var is_menu : boolean;
var can_activate_menu : boolean;
@ -246,6 +254,17 @@ begin
TCefWindowDelegateOwn(TempObject).OnWindowDestroyed(TCefWindowRef.UnWrap(window));
end;
procedure cef_window_delegate_on_window_activation_changed(self: PCefWindowDelegate; window: PCefWindow; active: integer); stdcall;
var
TempObject : TObject;
begin
TempObject := CefGetObject(self);
if (TempObject <> nil) and (TempObject is TCefWindowDelegateOwn) then
TCefWindowDelegateOwn(TempObject).OnWindowActivationChanged(TCefWindowRef.UnWrap(window),
active <> 0);
end;
function cef_window_delegate_get_parent_window(self : PCefWindowDelegate;
window : PCefWindow;
is_menu : PInteger;
@ -422,18 +441,19 @@ begin
with PCefWindowDelegate(FData)^ do
begin
on_window_created := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_created;
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;
can_minimize := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_can_minimize;
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_created := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_created;
on_window_destroyed := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_destroyed;
on_window_activation_changed := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_on_window_activation_changed;
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;
can_minimize := {$IFDEF FPC}@{$ENDIF}cef_window_delegate_can_minimize;
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;
end;
end;
@ -447,6 +467,11 @@ begin
//
end;
procedure TCefWindowDelegateOwn.OnWindowActivationChanged(const window: ICefWindow; active: boolean);
begin
//
end;
procedure TCefWindowDelegateOwn.OnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
begin
//
@ -641,6 +666,17 @@ begin
end;
end;
procedure TCustomWindowDelegate.OnWindowActivationChanged(const window: ICefWindow; active: boolean);
begin
try
if (FEvents <> nil) then
ICefWindowDelegateEvents(FEvents).doOnWindowActivationChanged(window, active);
except
on e : exception do
if CustomExceptionHandler('TCustomWindowDelegate.OnWindowActivationChanged', e) then raise;
end;
end;
procedure TCustomWindowDelegate.OnGetParentWindow(const window: ICefWindow; var is_menu, can_activate_menu: boolean; var aResult : ICefWindow);
begin
try

View File

@ -2,9 +2,9 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 395,
"InternalVersion" : 396,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "101.0.18.0"
"Version" : "102.0.8.0"
}
],
"UpdatePackageData" : {