mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-04-17 06:57:13 +02:00
Update to CEF 74.1.16
- Copied the GlobalCEFApp_OnWebKitInitializedEvent fix for D2007 made by jepp to other demos. - Added TChromium.DownloadImage and TChromium.OnDownloadImageFinished to download images - Added a TChromium.DownloadImage example to the MiniBrowser demo. - Modified some parameters in TCefImageRef
This commit is contained in:
parent
dc56584556
commit
59f3441b1e
@ -3,10 +3,10 @@ CEF4Delphi is an open source project created by Salvador D
|
|||||||
|
|
||||||
CEF4Delphi is based on DCEF3, made by Henri Gourvest. The original license of DCEF3 still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
|
CEF4Delphi is based on DCEF3, made by Henri Gourvest. The original license of DCEF3 still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
|
||||||
|
|
||||||
CEF4Delphi uses CEF 74.1.14 which includes Chromium 74.0.3729.131.
|
CEF4Delphi uses CEF 74.1.16 which includes Chromium 74.0.3729.131.
|
||||||
The CEF binaries used by CEF4Delphi are available for download at spotify :
|
The CEF binaries used by CEF4Delphi are available for download at spotify :
|
||||||
* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_74.1.14%2Bg50c3c5c%2Bchromium-74.0.3729.131_windows32.tar.bz2)
|
* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_74.1.16%2Bge20b240%2Bchromium-74.0.3729.131_windows32.tar.bz2)
|
||||||
* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_74.1.14%2Bg50c3c5c%2Bchromium-74.0.3729.131_windows64.tar.bz2)
|
* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_74.1.16%2Bge20b240%2Bchromium-74.0.3729.131_windows64.tar.bz2)
|
||||||
|
|
||||||
|
|
||||||
CEF4Delphi was developed and tested on Delphi 10.3 Rio and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2 and Lazarus 2.0.2/FPC 3.0.4. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
CEF4Delphi was developed and tested on Delphi 10.3 Rio and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2 and Lazarus 2.0.2/FPC 3.0.4. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
||||||
|
@ -92,6 +92,8 @@ type
|
|||||||
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
||||||
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
||||||
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
||||||
|
|
||||||
|
{$IFNDEF DELPHI12_UP}class procedure GlobalCEFApp_OnWebKitInitializedEvent;{$ENDIF}
|
||||||
public
|
public
|
||||||
{ Public declarations }
|
{ Public declarations }
|
||||||
end;
|
end;
|
||||||
@ -120,7 +122,8 @@ uses
|
|||||||
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
|
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
|
||||||
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
|
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
|
||||||
|
|
||||||
procedure GlobalCEFApp_OnWebKitInitializedEvent;
|
{$IFDEF DELPHI12_UP}procedure
|
||||||
|
{$ELSE}class procedure TJSSimpleExtensionFrm.{$ENDIF}GlobalCEFApp_OnWebKitInitializedEvent;
|
||||||
var
|
var
|
||||||
TempExtensionCode : string;
|
TempExtensionCode : string;
|
||||||
TempHandler : ICefv8Handler;
|
TempHandler : ICefv8Handler;
|
||||||
@ -146,7 +149,8 @@ end;
|
|||||||
procedure CreateGlobalCEFApp;
|
procedure CreateGlobalCEFApp;
|
||||||
begin
|
begin
|
||||||
GlobalCEFApp := TCefApplication.Create;
|
GlobalCEFApp := TCefApplication.Create;
|
||||||
GlobalCEFApp.OnWebKitInitialized := GlobalCEFApp_OnWebKitInitializedEvent;
|
GlobalCEFApp.OnWebKitInitialized := {$IFNDEF DELPHI12_UP}TJSSimpleExtensionFrm.{$ENDIF}
|
||||||
|
GlobalCEFApp_OnWebKitInitializedEvent;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJSExtensionWithFunctionFrm.GoBtnClick(Sender: TObject);
|
procedure TJSExtensionWithFunctionFrm.GoBtnClick(Sender: TObject);
|
||||||
|
@ -88,6 +88,8 @@ type
|
|||||||
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
||||||
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
||||||
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
||||||
|
|
||||||
|
{$IFNDEF DELPHI12_UP}class procedure GlobalCEFApp_OnWebKitInitializedEvent;{$ENDIF}
|
||||||
public
|
public
|
||||||
{ Public declarations }
|
{ Public declarations }
|
||||||
end;
|
end;
|
||||||
@ -119,7 +121,8 @@ uses
|
|||||||
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
|
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
|
||||||
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
|
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
|
||||||
|
|
||||||
procedure GlobalCEFApp_OnWebKitInitializedEvent;
|
{$IFDEF DELPHI12_UP}procedure
|
||||||
|
{$ELSE}class procedure TJSSimpleExtensionFrm.{$ENDIF}GlobalCEFApp_OnWebKitInitializedEvent;
|
||||||
var
|
var
|
||||||
TempExtensionCode : string;
|
TempExtensionCode : string;
|
||||||
TempHandler : ICefv8Handler;
|
TempHandler : ICefv8Handler;
|
||||||
@ -149,7 +152,8 @@ end;
|
|||||||
procedure CreateGlobalCEFApp;
|
procedure CreateGlobalCEFApp;
|
||||||
begin
|
begin
|
||||||
GlobalCEFApp := TCefApplication.Create;
|
GlobalCEFApp := TCefApplication.Create;
|
||||||
GlobalCEFApp.OnWebKitInitialized := GlobalCEFApp_OnWebKitInitializedEvent;
|
GlobalCEFApp.OnWebKitInitialized := {$IFNDEF DELPHI12_UP}TJSSimpleExtensionFrm.{$ENDIF}
|
||||||
|
GlobalCEFApp_OnWebKitInitializedEvent;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJSExtensionWithObjectParameterFrm.GoBtnClick(Sender: TObject);
|
procedure TJSExtensionWithObjectParameterFrm.GoBtnClick(Sender: TObject);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// ************************************************************************
|
// ************************************************************************
|
||||||
// ***************************** CEF4Delphi *******************************
|
// ***************************** CEF4Delphi *******************************
|
||||||
// ************************************************************************
|
// ************************************************************************
|
||||||
//
|
//
|
||||||
@ -88,6 +88,7 @@ type
|
|||||||
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
||||||
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
||||||
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
||||||
|
|
||||||
{$IFNDEF DELPHI12_UP}class procedure GlobalCEFApp_OnWebKitInitializedEvent;{$ENDIF}
|
{$IFNDEF DELPHI12_UP}class procedure GlobalCEFApp_OnWebKitInitializedEvent;{$ENDIF}
|
||||||
public
|
public
|
||||||
{ Public declarations }
|
{ Public declarations }
|
||||||
|
@ -137,6 +137,9 @@ object MiniBrowserFrm: TMiniBrowserFrm
|
|||||||
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_win_close'
|
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_win_close'
|
||||||
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_alert'
|
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_alert'
|
||||||
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_loc_assign'
|
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_loc_assign'
|
||||||
|
|
||||||
|
'https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_styl' +
|
||||||
|
'e_backgroundcolor'
|
||||||
'https://www.w3schools.com/html/html5_video.asp'
|
'https://www.w3schools.com/html/html5_video.asp'
|
||||||
'http://www.adobe.com/software/flash/about/'
|
'http://www.adobe.com/software/flash/about/'
|
||||||
'http://isflashinstalled.com/'
|
'http://isflashinstalled.com/'
|
||||||
@ -264,6 +267,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
|
|||||||
OnPrefsAvailable = Chromium1PrefsAvailable
|
OnPrefsAvailable = Chromium1PrefsAvailable
|
||||||
OnResolvedHostAvailable = Chromium1ResolvedHostAvailable
|
OnResolvedHostAvailable = Chromium1ResolvedHostAvailable
|
||||||
OnNavigationVisitorResultAvailable = Chromium1NavigationVisitorResultAvailable
|
OnNavigationVisitorResultAvailable = Chromium1NavigationVisitorResultAvailable
|
||||||
|
OnDownloadImageFinished = Chromium1DownloadImageFinished
|
||||||
OnRenderCompMsg = Chromium1RenderCompMsg
|
OnRenderCompMsg = Chromium1RenderCompMsg
|
||||||
OnLoadEnd = Chromium1LoadEnd
|
OnLoadEnd = Chromium1LoadEnd
|
||||||
OnLoadError = Chromium1LoadError
|
OnLoadError = Chromium1LoadError
|
||||||
@ -347,6 +351,10 @@ object MiniBrowserFrm: TMiniBrowserFrm
|
|||||||
Caption = 'Resolve host...'
|
Caption = 'Resolve host...'
|
||||||
OnClick = Resolvehost1Click
|
OnClick = Resolvehost1Click
|
||||||
end
|
end
|
||||||
|
object Downloadimage1: TMenuItem
|
||||||
|
Caption = 'Download image...'
|
||||||
|
OnClick = Downloadimage1Click
|
||||||
|
end
|
||||||
object N5: TMenuItem
|
object N5: TMenuItem
|
||||||
Caption = '-'
|
Caption = '-'
|
||||||
end
|
end
|
||||||
|
@ -122,6 +122,7 @@ type
|
|||||||
OpenfilewithaDAT1: TMenuItem;
|
OpenfilewithaDAT1: TMenuItem;
|
||||||
N5: TMenuItem;
|
N5: TMenuItem;
|
||||||
Memoryinfo1: TMenuItem;
|
Memoryinfo1: TMenuItem;
|
||||||
|
Downloadimage1: TMenuItem;
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
procedure BackBtnClick(Sender: TObject);
|
procedure BackBtnClick(Sender: TObject);
|
||||||
procedure ForwardBtnClick(Sender: TObject);
|
procedure ForwardBtnClick(Sender: TObject);
|
||||||
@ -215,6 +216,10 @@ type
|
|||||||
procedure Chromium1NavigationVisitorResultAvailable(
|
procedure Chromium1NavigationVisitorResultAvailable(
|
||||||
const entry: ICefNavigationEntry; current: Boolean; index, total: Integer;
|
const entry: ICefNavigationEntry; current: Boolean; index, total: Integer;
|
||||||
var aResult: Boolean);
|
var aResult: Boolean);
|
||||||
|
procedure Downloadimage1Click(Sender: TObject);
|
||||||
|
procedure Chromium1DownloadImageFinished(Sender: TObject;
|
||||||
|
const imageUrl: ustring; httpStatusCode: Integer;
|
||||||
|
const image: ICefImage);
|
||||||
|
|
||||||
protected
|
protected
|
||||||
FResponse : TStringList;
|
FResponse : TStringList;
|
||||||
@ -1216,6 +1221,82 @@ begin
|
|||||||
ShowDevTools;
|
ShowDevTools;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMiniBrowserFrm.Downloadimage1Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
TempURL : string;
|
||||||
|
begin
|
||||||
|
TempURL := InputBox('Download Image', 'URL:', 'https://www.briskbard.com/images/logo.png');
|
||||||
|
|
||||||
|
if (length(TempURL) > 0) then
|
||||||
|
Chromium1.DownloadImage(TempURL, False, 0, False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMiniBrowserFrm.Chromium1DownloadImageFinished( Sender : TObject;
|
||||||
|
const imageUrl : ustring;
|
||||||
|
httpStatusCode : Integer;
|
||||||
|
const image : ICefImage);
|
||||||
|
var
|
||||||
|
TempBinValue : ICefBinaryValue;
|
||||||
|
TempWidth : integer;
|
||||||
|
TempHeight : integer;
|
||||||
|
TempBuffer : TBytes;
|
||||||
|
TempPointer : pointer;
|
||||||
|
TempSize : NativeUInt;
|
||||||
|
TempStream : TFileStream;
|
||||||
|
TempParts : TUrlParts;
|
||||||
|
i : integer;
|
||||||
|
begin
|
||||||
|
TempStream := nil;
|
||||||
|
|
||||||
|
try
|
||||||
|
try
|
||||||
|
if (httpStatusCode = 200) and (image <> nil) and not(image.IsEmpty) then
|
||||||
|
begin
|
||||||
|
TempBinValue := image.GetAsPng(1, True, TempWidth, TempHeight);
|
||||||
|
|
||||||
|
if (TempBinValue <> nil) and
|
||||||
|
TempBinValue.IsValid then
|
||||||
|
begin
|
||||||
|
TempSize := TempBinValue.Size;
|
||||||
|
|
||||||
|
SaveDialog1.DefaultExt := 'png';
|
||||||
|
SaveDialog1.Filter := 'PNG files (*.png)|*.PNG';
|
||||||
|
|
||||||
|
CefParseUrl(imageUrl, TempParts);
|
||||||
|
i := LastDelimiter('/', TempParts.path);
|
||||||
|
|
||||||
|
// TODO : The file name should be sanitized.
|
||||||
|
if (i > 0) then
|
||||||
|
SaveDialog1.FileName := copy(TempParts.path, succ(i), length(TempParts.path))
|
||||||
|
else
|
||||||
|
SaveDialog1.FileName := TempParts.path;
|
||||||
|
|
||||||
|
if (TempSize > 0) and
|
||||||
|
SaveDialog1.Execute and
|
||||||
|
(length(SaveDialog1.FileName) > 0) then
|
||||||
|
begin
|
||||||
|
SetLength(TempBuffer, TempSize);
|
||||||
|
TempPointer := @TempBuffer[0];
|
||||||
|
TempSize := TempBinValue.GetData(TempPointer, TempSize, 0);
|
||||||
|
|
||||||
|
if (TempSize > 0) then
|
||||||
|
begin
|
||||||
|
TempStream := TFileStream.Create(SaveDialog1.FileName, fmCreate);
|
||||||
|
TempStream.Write(TempBuffer, TempSize);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('Chromium1DownloadImageFinishedEvent', e) then raise;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
if (TempStream <> nil) then FreeAndNil(TempStream);
|
||||||
|
SetLength(TempBuffer, 0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMiniBrowserFrm.ShowDevTools(aPoint : TPoint);
|
procedure TMiniBrowserFrm.ShowDevTools(aPoint : TPoint);
|
||||||
begin
|
begin
|
||||||
Splitter1.Visible := True;
|
Splitter1.Visible := True;
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
object ChildForm: TChildForm
|
object ChildForm: TChildForm
|
||||||
Left = 224
|
Left = 45
|
||||||
Height = 600
|
Height = 503
|
||||||
Top = 175
|
Top = 239
|
||||||
Width = 800
|
Width = 800
|
||||||
BorderIcons = [biSystemMenu, biMinimize]
|
BorderIcons = [biSystemMenu, biMinimize]
|
||||||
BorderStyle = bsSingle
|
BorderStyle = bsSingle
|
||||||
Caption = 'ChildForm'
|
Caption = 'ChildForm'
|
||||||
ClientHeight = 600
|
ClientHeight = 503
|
||||||
ClientWidth = 800
|
ClientWidth = 800
|
||||||
OnClose = FormClose
|
OnClose = FormClose
|
||||||
OnCloseQuery = FormCloseQuery
|
OnCloseQuery = FormCloseQuery
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
OnShow = FormShow
|
OnShow = FormShow
|
||||||
LCLVersion = '2.0.0.4'
|
LCLVersion = '2.0.2.0'
|
||||||
object CEFWindowParent1: TCEFWindowParent
|
object CEFWindowParent1: TCEFWindowParent
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 600
|
Height = 503
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 800
|
Width = 800
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
</CompilerOptions>
|
</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."/>
|
<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"/>
|
<License Value="MPL 1.1"/>
|
||||||
<Version Major="74" Minor="1" Release="14"/>
|
<Version Major="74" Minor="1" Release="16"/>
|
||||||
<Files Count="139">
|
<Files Count="139">
|
||||||
<Item1>
|
<Item1>
|
||||||
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
||||||
|
@ -62,7 +62,7 @@ uses
|
|||||||
const
|
const
|
||||||
CEF_SUPPORTED_VERSION_MAJOR = 74;
|
CEF_SUPPORTED_VERSION_MAJOR = 74;
|
||||||
CEF_SUPPORTED_VERSION_MINOR = 1;
|
CEF_SUPPORTED_VERSION_MINOR = 1;
|
||||||
CEF_SUPPORTED_VERSION_RELEASE = 14;
|
CEF_SUPPORTED_VERSION_RELEASE = 16;
|
||||||
CEF_SUPPORTED_VERSION_BUILD = 0;
|
CEF_SUPPORTED_VERSION_BUILD = 0;
|
||||||
|
|
||||||
CEF_CHROMEELF_VERSION_MAJOR = 74;
|
CEF_CHROMEELF_VERSION_MAJOR = 74;
|
||||||
|
@ -240,6 +240,7 @@ type
|
|||||||
FOnCookiesDeleted : TOnCookiesDeletedEvent;
|
FOnCookiesDeleted : TOnCookiesDeletedEvent;
|
||||||
FOnResolvedHostAvailable : TOnResolvedIPsAvailableEvent;
|
FOnResolvedHostAvailable : TOnResolvedIPsAvailableEvent;
|
||||||
FOnNavigationVisitorResultAvailable : TOnNavigationVisitorResultAvailableEvent;
|
FOnNavigationVisitorResultAvailable : TOnNavigationVisitorResultAvailableEvent;
|
||||||
|
FOnDownloadImageFinished : TOnDownloadImageFinishedEvent;
|
||||||
{$IFNDEF FPC}
|
{$IFNDEF FPC}
|
||||||
FOnBrowserCompMsg : TOnCompMsgEvent;
|
FOnBrowserCompMsg : TOnCompMsgEvent;
|
||||||
FOnWidgetCompMsg : TOnCompMsgEvent;
|
FOnWidgetCompMsg : TOnCompMsgEvent;
|
||||||
@ -486,6 +487,7 @@ type
|
|||||||
function doSavePreferences : boolean; virtual;
|
function doSavePreferences : boolean; virtual;
|
||||||
procedure doResolvedHostAvailable(result: TCefErrorCode; const resolvedIps: TStrings); virtual;
|
procedure doResolvedHostAvailable(result: TCefErrorCode; const resolvedIps: TStrings); virtual;
|
||||||
function doNavigationVisitorResultAvailable(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer) : boolean; virtual;
|
function doNavigationVisitorResultAvailable(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer) : boolean; virtual;
|
||||||
|
procedure doDownloadImageFinished(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage);
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -513,6 +515,7 @@ type
|
|||||||
procedure ReloadIgnoreCache;
|
procedure ReloadIgnoreCache;
|
||||||
procedure StopLoad;
|
procedure StopLoad;
|
||||||
procedure StartDownload(const aURL : ustring);
|
procedure StartDownload(const aURL : ustring);
|
||||||
|
procedure DownloadImage(const imageUrl: ustring; isFavicon: Boolean; maxImageSize: cardinal; bypassCache: Boolean);
|
||||||
|
|
||||||
procedure SimulateMouseWheel(aDeltaX, aDeltaY : integer);
|
procedure SimulateMouseWheel(aDeltaX, aDeltaY : integer);
|
||||||
function DeleteCookies(const url : ustring = ''; const cookieName : ustring = '') : boolean;
|
function DeleteCookies(const url : ustring = ''; const cookieName : ustring = '') : boolean;
|
||||||
@ -663,6 +666,7 @@ type
|
|||||||
property OnCookiesDeleted : TOnCookiesDeletedEvent read FOnCookiesDeleted write FOnCookiesDeleted;
|
property OnCookiesDeleted : TOnCookiesDeletedEvent read FOnCookiesDeleted write FOnCookiesDeleted;
|
||||||
property OnResolvedHostAvailable : TOnResolvedIPsAvailableEvent read FOnResolvedHostAvailable write FOnResolvedHostAvailable;
|
property OnResolvedHostAvailable : TOnResolvedIPsAvailableEvent read FOnResolvedHostAvailable write FOnResolvedHostAvailable;
|
||||||
property OnNavigationVisitorResultAvailable : TOnNavigationVisitorResultAvailableEvent read FOnNavigationVisitorResultAvailable write FOnNavigationVisitorResultAvailable;
|
property OnNavigationVisitorResultAvailable : TOnNavigationVisitorResultAvailableEvent read FOnNavigationVisitorResultAvailable write FOnNavigationVisitorResultAvailable;
|
||||||
|
property OnDownloadImageFinished : TOnDownloadImageFinishedEvent read FOnDownloadImageFinished write FOnDownloadImageFinished;
|
||||||
{$IFNDEF FPC}
|
{$IFNDEF FPC}
|
||||||
property OnBrowserCompMsg : TOnCompMsgEvent read FOnBrowserCompMsg write FOnBrowserCompMsg;
|
property OnBrowserCompMsg : TOnCompMsgEvent read FOnBrowserCompMsg write FOnBrowserCompMsg;
|
||||||
property OnWidgetCompMsg : TOnCompMsgEvent read FOnWidgetCompMsg write FOnWidgetCompMsg;
|
property OnWidgetCompMsg : TOnCompMsgEvent read FOnWidgetCompMsg write FOnWidgetCompMsg;
|
||||||
@ -790,7 +794,7 @@ uses
|
|||||||
uCEFBrowser, uCEFValue, uCEFDictionaryValue, uCEFStringMultimap, uCEFFrame,
|
uCEFBrowser, uCEFValue, uCEFDictionaryValue, uCEFStringMultimap, uCEFFrame,
|
||||||
uCEFApplication, uCEFProcessMessage, uCEFRequestContext, {$IFNDEF FPC}uCEFOLEDragAndDrop,{$ENDIF}
|
uCEFApplication, uCEFProcessMessage, uCEFRequestContext, {$IFNDEF FPC}uCEFOLEDragAndDrop,{$ENDIF}
|
||||||
uCEFPDFPrintCallback, uCEFResolveCallback, uCEFDeleteCookiesCallback, uCEFStringVisitor,
|
uCEFPDFPrintCallback, uCEFResolveCallback, uCEFDeleteCookiesCallback, uCEFStringVisitor,
|
||||||
uCEFListValue, uCEFNavigationEntryVisitor;
|
uCEFListValue, uCEFNavigationEntryVisitor, uCEFDownloadImageCallBack;
|
||||||
|
|
||||||
constructor TChromium.Create(AOwner: TComponent);
|
constructor TChromium.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
@ -1144,6 +1148,7 @@ begin
|
|||||||
FOnCookiesDeleted := nil;
|
FOnCookiesDeleted := nil;
|
||||||
FOnResolvedHostAvailable := nil;
|
FOnResolvedHostAvailable := nil;
|
||||||
FOnNavigationVisitorResultAvailable := nil;
|
FOnNavigationVisitorResultAvailable := nil;
|
||||||
|
FOnDownloadImageFinished := nil;
|
||||||
{$IFNDEF FPC}
|
{$IFNDEF FPC}
|
||||||
FOnBrowserCompMsg := nil;
|
FOnBrowserCompMsg := nil;
|
||||||
FOnWidgetCompMsg := nil;
|
FOnWidgetCompMsg := nil;
|
||||||
@ -1727,6 +1732,25 @@ begin
|
|||||||
if Initialized then FBrowser.Host.StartDownload(aURL);
|
if Initialized then FBrowser.Host.StartDownload(aURL);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Use the OnDownloadImageFinished event to receive the image
|
||||||
|
procedure TChromium.DownloadImage(const imageUrl : ustring;
|
||||||
|
isFavicon : boolean;
|
||||||
|
maxImageSize : cardinal;
|
||||||
|
bypassCache : boolean);
|
||||||
|
var
|
||||||
|
TempCallback : ICefDownloadImageCallback;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
if Initialized and (FBrowser.Host <> nil) then
|
||||||
|
begin
|
||||||
|
TempCallback := TCefCustomDownloadImageCallback.Create(self);
|
||||||
|
FBrowser.Host.DownloadImage(imageUrl, isFavicon, maxImageSize, bypassCache, TempCallback);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
TempCallback := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TChromium.GetIsLoading : boolean;
|
function TChromium.GetIsLoading : boolean;
|
||||||
begin
|
begin
|
||||||
Result := Initialized and FBrowser.IsLoading;
|
Result := Initialized and FBrowser.IsLoading;
|
||||||
@ -2950,6 +2974,14 @@ begin
|
|||||||
FOnNavigationVisitorResultAvailable(entry, current, index, total, Result);
|
FOnNavigationVisitorResultAvailable(entry, current, index, total, Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TChromium.doDownloadImageFinished(const imageUrl : ustring;
|
||||||
|
httpStatusCode : Integer;
|
||||||
|
const image : ICefImage);
|
||||||
|
begin
|
||||||
|
if assigned(FOnDownloadImageFinished) then
|
||||||
|
FOnDownloadImageFinished(self, imageUrl, httpStatusCode, image);
|
||||||
|
end;
|
||||||
|
|
||||||
function TChromium.MustCreateLoadHandler : boolean;
|
function TChromium.MustCreateLoadHandler : boolean;
|
||||||
begin
|
begin
|
||||||
Result := assigned(FOnLoadStart) or
|
Result := assigned(FOnLoadStart) or
|
||||||
|
@ -168,6 +168,7 @@ type
|
|||||||
TOnCookiesDeletedEvent = procedure(Sender: TObject; numDeleted : integer) of object;
|
TOnCookiesDeletedEvent = procedure(Sender: TObject; numDeleted : integer) of object;
|
||||||
TOnResolvedIPsAvailableEvent = procedure(Sender: TObject; result: TCefErrorCode; const resolvedIps: TStrings) of object;
|
TOnResolvedIPsAvailableEvent = procedure(Sender: TObject; result: TCefErrorCode; const resolvedIps: TStrings) of object;
|
||||||
TOnNavigationVisitorResultAvailableEvent = procedure(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer; var aResult : boolean) of object;
|
TOnNavigationVisitorResultAvailableEvent = procedure(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer; var aResult : boolean) of object;
|
||||||
|
TOnDownloadImageFinishedEvent = procedure(Sender: TObject; const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage) of object;
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
TOnCompMsgEvent = procedure(var aMessage: TMessage; var aHandled: Boolean) of object;
|
TOnCompMsgEvent = procedure(var aMessage: TMessage; var aHandled: Boolean) of object;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
@ -70,11 +70,31 @@ type
|
|||||||
constructor Create(const proc: TOnDownloadImageFinishedProc); reintroduce;
|
constructor Create(const proc: TOnDownloadImageFinishedProc); reintroduce;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TCefCustomDownloadImageCallback = class(TCefDownloadImageCallbackOwn)
|
||||||
|
protected
|
||||||
|
FEvents : Pointer;
|
||||||
|
|
||||||
|
procedure OnDownloadImageFinished(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage); override;
|
||||||
|
|
||||||
|
public
|
||||||
|
constructor Create(const aEvents : IChromiumEvents); reintroduce;
|
||||||
|
destructor Destroy; override;
|
||||||
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.SysUtils,
|
||||||
|
{$ELSE}
|
||||||
|
SysUtils,
|
||||||
|
{$ENDIF}
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFImage;
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFImage;
|
||||||
|
|
||||||
|
|
||||||
|
// TCefDownloadImageCallbackOwn
|
||||||
|
|
||||||
procedure cef_download_image_callback_on_download_image_finished( self : PCefDownloadImageCallback;
|
procedure cef_download_image_callback_on_download_image_finished( self : PCefDownloadImageCallback;
|
||||||
const image_url : PCefString;
|
const image_url : PCefString;
|
||||||
http_status_code : Integer;
|
http_status_code : Integer;
|
||||||
@ -98,6 +118,9 @@ begin
|
|||||||
on_download_image_finished := {$IFDEF FPC}@{$ENDIF}cef_download_image_callback_on_download_image_finished;
|
on_download_image_finished := {$IFDEF FPC}@{$ENDIF}cef_download_image_callback_on_download_image_finished;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
// TCefFastDownloadImageCallback
|
||||||
|
|
||||||
constructor TCefFastDownloadImageCallback.Create(const proc: TOnDownloadImageFinishedProc);
|
constructor TCefFastDownloadImageCallback.Create(const proc: TOnDownloadImageFinishedProc);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
@ -111,5 +134,37 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
// TCefCustomDownloadImageCallback
|
||||||
|
|
||||||
|
constructor TCefCustomDownloadImageCallback.Create(const aEvents : IChromiumEvents);
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
|
||||||
|
FEvents := Pointer(aEvents);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TCefCustomDownloadImageCallback.Destroy;
|
||||||
|
begin
|
||||||
|
FEvents := nil;
|
||||||
|
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCefCustomDownloadImageCallback.OnDownloadImageFinished(const imageUrl : ustring;
|
||||||
|
httpStatusCode : Integer;
|
||||||
|
const image : ICefImage);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
try
|
||||||
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doDownloadImageFinished(imageUrl, httpStatusCode, image);
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCefCustomDownloadImageCallback.OnDownloadImageFinished', e) then raise;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
FEvents := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -223,6 +223,7 @@ type
|
|||||||
FOnCookiesDeleted : TOnCookiesDeletedEvent;
|
FOnCookiesDeleted : TOnCookiesDeletedEvent;
|
||||||
FOnResolvedHostAvailable : TOnResolvedIPsAvailableEvent;
|
FOnResolvedHostAvailable : TOnResolvedIPsAvailableEvent;
|
||||||
FOnNavigationVisitorResultAvailable : TOnNavigationVisitorResultAvailableEvent;
|
FOnNavigationVisitorResultAvailable : TOnNavigationVisitorResultAvailableEvent;
|
||||||
|
FOnDownloadImageFinished : TOnDownloadImageFinishedEvent;
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
FOnBrowserCompMsg : TOnCompMsgEvent;
|
FOnBrowserCompMsg : TOnCompMsgEvent;
|
||||||
FOnWidgetCompMsg : TOnCompMsgEvent;
|
FOnWidgetCompMsg : TOnCompMsgEvent;
|
||||||
@ -453,6 +454,7 @@ type
|
|||||||
function doSavePreferences : boolean; virtual;
|
function doSavePreferences : boolean; virtual;
|
||||||
procedure doResolvedHostAvailable(result: TCefErrorCode; const resolvedIps: TStrings); virtual;
|
procedure doResolvedHostAvailable(result: TCefErrorCode; const resolvedIps: TStrings); virtual;
|
||||||
function doNavigationVisitorResultAvailable(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer) : boolean; virtual;
|
function doNavigationVisitorResultAvailable(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer) : boolean; virtual;
|
||||||
|
procedure doDownloadImageFinished(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage);
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -480,6 +482,7 @@ type
|
|||||||
procedure ReloadIgnoreCache;
|
procedure ReloadIgnoreCache;
|
||||||
procedure StopLoad;
|
procedure StopLoad;
|
||||||
procedure StartDownload(const aURL : ustring);
|
procedure StartDownload(const aURL : ustring);
|
||||||
|
procedure DownloadImage(const imageUrl: ustring; isFavicon: Boolean; maxImageSize: cardinal; bypassCache: Boolean);
|
||||||
|
|
||||||
procedure SimulateMouseWheel(aDeltaX, aDeltaY : integer);
|
procedure SimulateMouseWheel(aDeltaX, aDeltaY : integer);
|
||||||
function DeleteCookies(const url : ustring = ''; const cookieName : ustring = '') : boolean;
|
function DeleteCookies(const url : ustring = ''; const cookieName : ustring = '') : boolean;
|
||||||
@ -619,6 +622,7 @@ type
|
|||||||
property OnCookiesDeleted : TOnCookiesDeletedEvent read FOnCookiesDeleted write FOnCookiesDeleted;
|
property OnCookiesDeleted : TOnCookiesDeletedEvent read FOnCookiesDeleted write FOnCookiesDeleted;
|
||||||
property OnResolvedHostAvailable : TOnResolvedIPsAvailableEvent read FOnResolvedHostAvailable write FOnResolvedHostAvailable;
|
property OnResolvedHostAvailable : TOnResolvedIPsAvailableEvent read FOnResolvedHostAvailable write FOnResolvedHostAvailable;
|
||||||
property OnNavigationVisitorResultAvailable : TOnNavigationVisitorResultAvailableEvent read FOnNavigationVisitorResultAvailable write FOnNavigationVisitorResultAvailable;
|
property OnNavigationVisitorResultAvailable : TOnNavigationVisitorResultAvailableEvent read FOnNavigationVisitorResultAvailable write FOnNavigationVisitorResultAvailable;
|
||||||
|
property OnDownloadImageFinishedEvent : TOnDownloadImageFinishedEvent read FOnDownloadImageFinished write FOnDownloadImageFinished;
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
property OnBrowserCompMsg : TOnCompMsgEvent read FOnBrowserCompMsg write FOnBrowserCompMsg;
|
property OnBrowserCompMsg : TOnCompMsgEvent read FOnBrowserCompMsg write FOnBrowserCompMsg;
|
||||||
property OnWidgetCompMsg : TOnCompMsgEvent read FOnWidgetCompMsg write FOnWidgetCompMsg;
|
property OnWidgetCompMsg : TOnCompMsgEvent read FOnWidgetCompMsg write FOnWidgetCompMsg;
|
||||||
@ -736,7 +740,7 @@ uses
|
|||||||
uCEFBrowser, uCEFValue, uCEFDictionaryValue, uCEFStringMultimap, uCEFFrame,
|
uCEFBrowser, uCEFValue, uCEFDictionaryValue, uCEFStringMultimap, uCEFFrame,
|
||||||
uCEFApplication, uCEFProcessMessage, uCEFRequestContext,
|
uCEFApplication, uCEFProcessMessage, uCEFRequestContext,
|
||||||
uCEFPDFPrintCallback, uCEFResolveCallback, uCEFDeleteCookiesCallback, uCEFStringVisitor,
|
uCEFPDFPrintCallback, uCEFResolveCallback, uCEFDeleteCookiesCallback, uCEFStringVisitor,
|
||||||
uCEFListValue, uCEFNavigationEntryVisitor;
|
uCEFListValue, uCEFNavigationEntryVisitor, uCEFDownloadImageCallBack;
|
||||||
|
|
||||||
constructor TFMXChromium.Create(AOwner: TComponent);
|
constructor TFMXChromium.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
@ -1045,6 +1049,7 @@ begin
|
|||||||
FOnCookiesDeleted := nil;
|
FOnCookiesDeleted := nil;
|
||||||
FOnResolvedHostAvailable := nil;
|
FOnResolvedHostAvailable := nil;
|
||||||
FOnNavigationVisitorResultAvailable := nil;
|
FOnNavigationVisitorResultAvailable := nil;
|
||||||
|
FOnDownloadImageFinished := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFMXChromium.CreateBrowser(const aWindowName : ustring;
|
function TFMXChromium.CreateBrowser(const aWindowName : ustring;
|
||||||
@ -1512,6 +1517,25 @@ begin
|
|||||||
if Initialized then FBrowser.Host.StartDownload(aURL);
|
if Initialized then FBrowser.Host.StartDownload(aURL);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Use the OnDownloadImageFinished event to receive the image
|
||||||
|
procedure TFMXChromium.DownloadImage(const imageUrl : ustring;
|
||||||
|
isFavicon : boolean;
|
||||||
|
maxImageSize : cardinal;
|
||||||
|
bypassCache : boolean);
|
||||||
|
var
|
||||||
|
TempCallback : ICefDownloadImageCallback;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
if Initialized and (FBrowser.Host <> nil) then
|
||||||
|
begin
|
||||||
|
TempCallback := TCefCustomDownloadImageCallback.Create(self);
|
||||||
|
FBrowser.Host.DownloadImage(imageUrl, isFavicon, maxImageSize, bypassCache, TempCallback);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
TempCallback := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TFMXChromium.GetIsLoading : boolean;
|
function TFMXChromium.GetIsLoading : boolean;
|
||||||
begin
|
begin
|
||||||
Result := Initialized and FBrowser.IsLoading;
|
Result := Initialized and FBrowser.IsLoading;
|
||||||
@ -2681,6 +2705,14 @@ begin
|
|||||||
FOnNavigationVisitorResultAvailable(entry, current, index, total, Result);
|
FOnNavigationVisitorResultAvailable(entry, current, index, total, Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFMXChromium.doDownloadImageFinished(const imageUrl : ustring;
|
||||||
|
httpStatusCode : Integer;
|
||||||
|
const image : ICefImage);
|
||||||
|
begin
|
||||||
|
if assigned(FOnDownloadImageFinished) then
|
||||||
|
FOnDownloadImageFinished(self, imageUrl, httpStatusCode, image);
|
||||||
|
end;
|
||||||
|
|
||||||
function TFMXChromium.MustCreateLoadHandler : boolean;
|
function TFMXChromium.MustCreateLoadHandler : boolean;
|
||||||
begin
|
begin
|
||||||
Result := assigned(FOnLoadStart) or
|
Result := assigned(FOnLoadStart) or
|
||||||
|
@ -68,10 +68,10 @@ type
|
|||||||
function GetHeight: NativeUInt;
|
function GetHeight: NativeUInt;
|
||||||
function HasRepresentation(scaleFactor: Single): Boolean;
|
function HasRepresentation(scaleFactor: Single): Boolean;
|
||||||
function RemoveRepresentation(scaleFactor: Single): Boolean;
|
function RemoveRepresentation(scaleFactor: Single): Boolean;
|
||||||
function GetRepresentationInfo(scaleFactor: Single; actualScaleFactor: PSingle; pixelWidth, pixelHeight: PInteger): Boolean;
|
function GetRepresentationInfo(scaleFactor: Single; var actualScaleFactor: Single; var pixelWidth, pixelHeight: Integer): Boolean;
|
||||||
function GetAsBitmap(scaleFactor: Single; colorType: TCefColorType; alphaType: TCefAlphaType; pixelWidth, pixelHeight: PInteger): ICefBinaryValue;
|
function GetAsBitmap(scaleFactor: Single; colorType: TCefColorType; alphaType: TCefAlphaType; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;
|
||||||
function GetAsPng(scaleFactor: Single; withTransparency: Boolean; pixelWidth, pixelHeight: PInteger): ICefBinaryValue;
|
function GetAsPng(scaleFactor: Single; withTransparency: Boolean; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;
|
||||||
function GetAsJpeg(scaleFactor: Single; quality: Integer; pixelWidth, pixelHeight: PInteger): ICefBinaryValue;
|
function GetAsJpeg(scaleFactor: Single; quality: Integer; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;
|
||||||
public
|
public
|
||||||
class function UnWrap(data: Pointer): ICefImage;
|
class function UnWrap(data: Pointer): ICefImage;
|
||||||
class function New: ICefImage;
|
class function New: ICefImage;
|
||||||
@ -103,19 +103,19 @@ begin
|
|||||||
Result := PCefImage(FData)^.add_png(FData, scaleFactor, pngData, pngDataSize) <> 0;
|
Result := PCefImage(FData)^.add_png(FData, scaleFactor, pngData, pngDataSize) <> 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefImageRef.GetAsBitmap(scaleFactor: Single; colorType: TCefColorType; alphaType: TCefAlphaType; pixelWidth, pixelHeight: PInteger): ICefBinaryValue;
|
function TCefImageRef.GetAsBitmap(scaleFactor: Single; colorType: TCefColorType; alphaType: TCefAlphaType; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;
|
||||||
begin
|
begin
|
||||||
Result := TCefBinaryValueRef.UnWrap(PCefImage(FData)^.get_as_bitmap(FData, scaleFactor, colorType, alphaType, pixelWidth, pixelHeight));
|
Result := TCefBinaryValueRef.UnWrap(PCefImage(FData)^.get_as_bitmap(FData, scaleFactor, colorType, alphaType, @pixelWidth, @pixelHeight));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefImageRef.GetAsJpeg(scaleFactor: Single; quality: Integer; pixelWidth, pixelHeight: PInteger): ICefBinaryValue;
|
function TCefImageRef.GetAsJpeg(scaleFactor: Single; quality: Integer; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;
|
||||||
begin
|
begin
|
||||||
Result := TCefBinaryValueRef.UnWrap(PCefImage(FData)^.get_as_jpeg(FData, scaleFactor, quality, pixelWidth, pixelHeight));
|
Result := TCefBinaryValueRef.UnWrap(PCefImage(FData)^.get_as_jpeg(FData, scaleFactor, quality, @pixelWidth, @pixelHeight));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefImageRef.GetAsPng(scaleFactor: Single; withTransparency: Boolean; pixelWidth, pixelHeight: PInteger): ICefBinaryValue;
|
function TCefImageRef.GetAsPng(scaleFactor: Single; withTransparency: Boolean; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;
|
||||||
begin
|
begin
|
||||||
Result := TCefBinaryValueRef.UnWrap(PCefImage(FData)^.get_as_png(FData, scaleFactor, Ord(withTransparency), pixelWidth, pixelHeight));
|
Result := TCefBinaryValueRef.UnWrap(PCefImage(FData)^.get_as_png(FData, scaleFactor, Ord(withTransparency), @pixelWidth, @pixelHeight));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefImageRef.GetHeight: NativeUInt;
|
function TCefImageRef.GetHeight: NativeUInt;
|
||||||
@ -123,9 +123,9 @@ begin
|
|||||||
Result := PCefImage(FData)^.get_height(FData);
|
Result := PCefImage(FData)^.get_height(FData);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefImageRef.GetRepresentationInfo(scaleFactor: Single; actualScaleFactor: PSingle; pixelWidth, pixelHeight: PInteger): Boolean;
|
function TCefImageRef.GetRepresentationInfo(scaleFactor: Single; var actualScaleFactor: Single; var pixelWidth, pixelHeight: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := PCefImage(FData)^.get_representation_info(FData, scaleFactor, actualScaleFactor, pixelWidth, pixelHeight) <> 0;
|
Result := PCefImage(FData)^.get_representation_info(FData, scaleFactor, @actualScaleFactor, @pixelWidth, @pixelHeight) <> 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefImageRef.GetWidth: NativeUInt;
|
function TCefImageRef.GetWidth: NativeUInt;
|
||||||
|
@ -379,6 +379,8 @@ type
|
|||||||
function doSavePreferences : boolean;
|
function doSavePreferences : boolean;
|
||||||
procedure doResolvedHostAvailable(result: TCefErrorCode; const resolvedIps: TStrings);
|
procedure doResolvedHostAvailable(result: TCefErrorCode; const resolvedIps: TStrings);
|
||||||
function doNavigationVisitorResultAvailable(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer) : boolean;
|
function doNavigationVisitorResultAvailable(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer) : boolean;
|
||||||
|
procedure doDownloadImageFinished(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
IServerEvents = interface
|
IServerEvents = interface
|
||||||
@ -2132,10 +2134,10 @@ type
|
|||||||
function GetHeight: NativeUInt;
|
function GetHeight: NativeUInt;
|
||||||
function HasRepresentation(scaleFactor: Single): Boolean;
|
function HasRepresentation(scaleFactor: Single): Boolean;
|
||||||
function RemoveRepresentation(scaleFactor: Single): Boolean;
|
function RemoveRepresentation(scaleFactor: Single): Boolean;
|
||||||
function GetRepresentationInfo(scaleFactor: Single; actualScaleFactor: PSingle; pixelWidth, pixelHeight: PInteger): Boolean;
|
function GetRepresentationInfo(scaleFactor: Single; var actualScaleFactor: Single; var pixelWidth, pixelHeight: Integer): Boolean;
|
||||||
function GetAsBitmap(scaleFactor: Single; colorType: TCefColorType; alphaType: TCefAlphaType; pixelWidth, pixelHeight: PInteger): ICefBinaryValue;
|
function GetAsBitmap(scaleFactor: Single; colorType: TCefColorType; alphaType: TCefAlphaType; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;
|
||||||
function GetAsPng(scaleFactor: Single; withTransparency: Boolean; pixelWidth, pixelHeight: PInteger): ICefBinaryValue;
|
function GetAsPng(scaleFactor: Single; withTransparency: Boolean; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;
|
||||||
function GetAsJpeg(scaleFactor: Single; quality: Integer; pixelWidth, pixelHeight: PInteger): ICefBinaryValue;
|
function GetAsJpeg(scaleFactor: Single; quality: Integer; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;
|
||||||
|
|
||||||
property Width : NativeUInt read GetWidth;
|
property Width : NativeUInt read GetWidth;
|
||||||
property Height : NativeUInt read GetHeight;
|
property Height : NativeUInt read GetHeight;
|
||||||
|
@ -1057,7 +1057,6 @@ begin
|
|||||||
TempList := TStringList.Create;
|
TempList := TStringList.Create;
|
||||||
TempList.Add(TempDir + CHROMEELF_DLL);
|
TempList.Add(TempDir + CHROMEELF_DLL);
|
||||||
TempList.Add(TempDir + LIBCEF_DLL);
|
TempList.Add(TempDir + LIBCEF_DLL);
|
||||||
TempList.Add(TempDir + 'd3dcompiler_43.dll');
|
|
||||||
TempList.Add(TempDir + 'd3dcompiler_47.dll');
|
TempList.Add(TempDir + 'd3dcompiler_47.dll');
|
||||||
TempList.Add(TempDir + 'libEGL.dll');
|
TempList.Add(TempDir + 'libEGL.dll');
|
||||||
TempList.Add(TempDir + 'libGLESv2.dll');
|
TempList.Add(TempDir + 'libGLESv2.dll');
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
"UpdateLazPackages" : [
|
"UpdateLazPackages" : [
|
||||||
{
|
{
|
||||||
"ForceNotify" : true,
|
"ForceNotify" : true,
|
||||||
"InternalVersion" : 7,
|
"InternalVersion" : 8,
|
||||||
"Name" : "cef4delphi_lazarus.lpk",
|
"Name" : "cef4delphi_lazarus.lpk",
|
||||||
"Version" : "74.1.14.0"
|
"Version" : "74.1.16.0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"UpdatePackageData" : {
|
"UpdatePackageData" : {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user