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

Update to CEF 3.3202.1690.gcd6b88f

- Update to CEF 3.3202.1690.gcd6b88f
- Bug fix #71
- Added the TCEFWorkScheduler class to handle the cef_do_message_loop_work calls when you use an external message pump.
- Added 2 demos using the "external message pump" mode.
- Added a TakeSnapshot function to the TChromium and TCEFWindowParent to take snapshots in non-OSR mode.
This commit is contained in:
Salvador Díaz Fau
2017-12-05 10:02:07 +01:00
parent 24f5a70f4b
commit 751fe924b7
35 changed files with 4776 additions and 258 deletions

View File

@ -445,6 +445,7 @@ type
procedure SavePreferences(const aFileName : string);
function SetNewBrowserParent(aNewParentHwnd : HWND) : boolean;
procedure ResolveHost(const aURL : ustring);
function TakeSnapshot(var aBitmap : TBitmap) : boolean;
procedure ShowDevTools(inspectElementAt: TPoint; const aDevTools : TWinControl);
procedure CloseDevTools(const aDevTools : TWinControl = nil);
@ -784,7 +785,7 @@ begin
if (FHandler = nil) then
begin
FIsOSR := aIsOsr;
FHandler := TVCLClientHandler.Create(Self, FIsOSR);
FHandler := TCustomClientHandler.Create(Self, FIsOSR);
Result := True;
end;
except
@ -2023,6 +2024,42 @@ begin
end;
end;
function TChromium.TakeSnapshot(var aBitmap : TBitmap) : boolean;
var
TempHWND : HWND;
TempDC : HDC;
TempRect : TRect;
TempWidth : Integer;
TempHeight : Integer;
begin
Result := False;
if not(FIsOSR) then
begin
TempHWND := GetWindowHandle;
if (TempHWND <> 0) then
begin
Winapi.Windows.GetClientRect(TempHWND, TempRect);
TempDC := GetDC(TempHWND);
TempWidth := TempRect.Right - TempRect.Left;
TempHeight := TempRect.Bottom - TempRect.Top;
if (aBitmap <> nil) then FreeAndNil(aBitmap);
aBitmap := TBitmap.Create;
aBitmap.Height := TempHeight;
aBitmap.Width := TempWidth;
Result := BitBlt(aBitmap.Canvas.Handle, 0, 0, TempWidth, TempHeight,
TempDC, 0, 0, SRCCOPY);
ReleaseDC(TempHWND, TempDC);
end;
end;
end;
procedure TChromium.SimulateMouseWheel(aDeltaX, aDeltaY : integer);
var
TempEvent : TCefMouseEvent;