2017-01-27 16:37:51 +01:00
|
|
|
|
// ************************************************************************
|
|
|
|
|
// ***************************** CEF4Delphi *******************************
|
|
|
|
|
// ************************************************************************
|
|
|
|
|
//
|
|
|
|
|
// CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based
|
|
|
|
|
// browser in Delphi applications.
|
|
|
|
|
//
|
|
|
|
|
// The original license of DCEF3 still applies to CEF4Delphi.
|
|
|
|
|
//
|
|
|
|
|
// For more information about CEF4Delphi visit :
|
|
|
|
|
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
|
|
|
|
//
|
2019-01-08 19:15:25 +01:00
|
|
|
|
// Copyright <20> 2019 Salvador Diaz Fau. All rights reserved.
|
2017-01-27 16:37:51 +01:00
|
|
|
|
//
|
|
|
|
|
// ************************************************************************
|
|
|
|
|
// ************ vvvv Original license and comments below vvvv *************
|
|
|
|
|
// ************************************************************************
|
|
|
|
|
(*
|
|
|
|
|
* Delphi Chromium Embedded 3
|
|
|
|
|
*
|
|
|
|
|
* Usage allowed under the restrictions of the Lesser GNU General Public License
|
|
|
|
|
* or alternatively the restrictions of the Mozilla Public License 1.1
|
|
|
|
|
*
|
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
|
|
|
|
* the specific language governing rights and limitations under the License.
|
|
|
|
|
*
|
|
|
|
|
* Unit owner : Henri Gourvest <hgourvest@gmail.com>
|
|
|
|
|
* Web site : http://www.progdigy.com
|
|
|
|
|
* Repository : http://code.google.com/p/delphichromiumembedded/
|
|
|
|
|
* Group : http://groups.google.com/group/delphichromiumembedded
|
|
|
|
|
*
|
|
|
|
|
* Embarcadero Technologies, Inc is not permitted to use or redistribute
|
|
|
|
|
* this source code without explicit permission.
|
|
|
|
|
*
|
|
|
|
|
*)
|
|
|
|
|
|
|
|
|
|
unit uCEFRenderHandler;
|
|
|
|
|
|
2018-05-12 14:50:54 +02:00
|
|
|
|
{$IFDEF FPC}
|
|
|
|
|
{$MODE OBJFPC}{$H+}
|
|
|
|
|
{$ENDIF}
|
|
|
|
|
|
2018-11-22 15:02:21 +01:00
|
|
|
|
{$IFNDEF CPUX64}{$ALIGN ON}{$ENDIF}
|
|
|
|
|
{$MINENUMSIZE 4}
|
2017-01-27 16:37:51 +01:00
|
|
|
|
|
2017-02-05 20:56:46 +01:00
|
|
|
|
{$I cef.inc}
|
|
|
|
|
|
2017-01-27 16:37:51 +01:00
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
2017-03-16 19:09:42 +01:00
|
|
|
|
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
|
|
|
|
|
type
|
2017-03-16 19:09:42 +01:00
|
|
|
|
TCefRenderHandlerOwn = class(TCefBaseRefCountedOwn, ICefRenderHandler)
|
2017-01-27 16:37:51 +01:00
|
|
|
|
protected
|
2017-06-06 12:49:27 +02:00
|
|
|
|
procedure GetAccessibilityHandler(var aAccessibilityHandler : ICefAccessibilityHandler); virtual;
|
2017-07-28 12:47:57 +02:00
|
|
|
|
function GetRootScreenRect(const browser: ICefBrowser; var rect: TCefRect): Boolean; virtual;
|
2018-12-12 17:13:23 +01:00
|
|
|
|
procedure GetViewRect(const browser: ICefBrowser; var rect: TCefRect); virtual;
|
2017-07-28 12:47:57 +02:00
|
|
|
|
function GetScreenPoint(const browser: ICefBrowser; viewX, viewY: Integer; var screenX, screenY: Integer): Boolean; virtual;
|
|
|
|
|
function GetScreenInfo(const browser: ICefBrowser; var screenInfo: TCefScreenInfo): Boolean; virtual;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
procedure OnPopupShow(const browser: ICefBrowser; show: Boolean); virtual;
|
|
|
|
|
procedure OnPopupSize(const browser: ICefBrowser; const rect: PCefRect); virtual;
|
|
|
|
|
procedure OnPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer); virtual;
|
2018-12-12 17:13:23 +01:00
|
|
|
|
procedure OnAcceleratedPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; shared_handle: Pointer); virtual;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
procedure OnCursorChange(const browser: ICefBrowser; cursor: TCefCursorHandle; CursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo); virtual;
|
|
|
|
|
function OnStartDragging(const browser: ICefBrowser; const dragData: ICefDragData; allowedOps: TCefDragOperations; x, y: Integer): Boolean; virtual;
|
|
|
|
|
procedure OnUpdateDragCursor(const browser: ICefBrowser; operation: TCefDragOperation); virtual;
|
|
|
|
|
procedure OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double); virtual;
|
|
|
|
|
procedure OnIMECompositionRangeChanged(const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect); virtual;
|
2018-04-20 12:45:06 +02:00
|
|
|
|
procedure OnTextSelectionChanged(const browser: ICefBrowser; const selected_text: ustring; const selected_range: PCefRange); virtual;
|
2019-03-15 17:17:14 +01:00
|
|
|
|
procedure OnVirtualKeyboardRequested(const browser: ICefBrowser; input_mode: TCefTextInpuMode); virtual;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
|
2018-02-03 17:52:48 +01:00
|
|
|
|
procedure RemoveReferences; virtual;
|
|
|
|
|
|
2017-01-27 16:37:51 +01:00
|
|
|
|
public
|
|
|
|
|
constructor Create; virtual;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
TCustomRenderHandler = class(TCefRenderHandlerOwn)
|
|
|
|
|
protected
|
2018-02-03 17:52:48 +01:00
|
|
|
|
FEvents : Pointer;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
|
2017-06-06 12:49:27 +02:00
|
|
|
|
procedure GetAccessibilityHandler(var aAccessibilityHandler : ICefAccessibilityHandler); override;
|
2017-07-28 12:47:57 +02:00
|
|
|
|
function GetRootScreenRect(const browser: ICefBrowser; var rect: TCefRect): Boolean; override;
|
2018-12-12 17:13:23 +01:00
|
|
|
|
procedure GetViewRect(const browser: ICefBrowser; var rect: TCefRect); override;
|
2017-07-28 12:47:57 +02:00
|
|
|
|
function GetScreenPoint(const browser: ICefBrowser; viewX, viewY: Integer; var screenX, screenY: Integer): Boolean; override;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
procedure OnPopupShow(const browser: ICefBrowser; show: Boolean); override;
|
|
|
|
|
procedure OnPopupSize(const browser: ICefBrowser; const rect: PCefRect); override;
|
|
|
|
|
procedure OnPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer); override;
|
2018-12-12 17:13:23 +01:00
|
|
|
|
procedure OnAcceleratedPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; shared_handle: Pointer); override;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
procedure OnCursorChange(const browser: ICefBrowser; cursor: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo); override;
|
2017-07-28 12:47:57 +02:00
|
|
|
|
function GetScreenInfo(const browser: ICefBrowser; var screenInfo: TCefScreenInfo): Boolean; override;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
function OnStartDragging(const browser: ICefBrowser; const dragData: ICefDragData; allowedOps: TCefDragOperations; x, y: Integer): Boolean; override;
|
|
|
|
|
procedure OnUpdateDragCursor(const browser: ICefBrowser; operation: TCefDragOperation); override;
|
|
|
|
|
procedure OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double); override;
|
|
|
|
|
procedure OnIMECompositionRangeChanged(const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect); override;
|
2018-04-20 12:45:06 +02:00
|
|
|
|
procedure OnTextSelectionChanged(const browser: ICefBrowser; const selected_text: ustring; const selected_range: PCefRange); override;
|
2019-03-15 17:17:14 +01:00
|
|
|
|
procedure OnVirtualKeyboardRequested(const browser: ICefBrowser; input_mode: TCefTextInpuMode); override;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
|
2018-02-03 17:52:48 +01:00
|
|
|
|
procedure RemoveReferences; override;
|
|
|
|
|
|
2017-01-27 16:37:51 +01:00
|
|
|
|
public
|
2019-06-19 16:53:26 +02:00
|
|
|
|
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
|
2017-06-11 17:48:20 +02:00
|
|
|
|
destructor Destroy; override;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
uses
|
2018-02-03 17:52:48 +01:00
|
|
|
|
{$IFDEF DELPHI16_UP}
|
|
|
|
|
System.SysUtils,
|
|
|
|
|
{$ELSE}
|
|
|
|
|
SysUtils,
|
|
|
|
|
{$ENDIF}
|
2017-01-27 16:37:51 +01:00
|
|
|
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFDragData;
|
|
|
|
|
|
|
|
|
|
|
2017-06-06 12:49:27 +02:00
|
|
|
|
function cef_render_handler_get_accessibility_handler(self: PCefRenderHandler): PCefAccessibilityHandler; stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempHandler : ICefAccessibilityHandler;
|
2018-03-29 20:02:04 +02:00
|
|
|
|
TempObject : TObject;
|
2017-06-06 12:49:27 +02:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
Result := nil;
|
|
|
|
|
TempHandler := nil;
|
|
|
|
|
TempObject := CefGetObject(self);
|
2017-06-06 12:49:27 +02:00
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
begin
|
|
|
|
|
TCefRenderHandlerOwn(TempObject).GetAccessibilityHandler(TempHandler);
|
2017-06-06 12:49:27 +02:00
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
if (TempHandler <> nil) then Result := TempHandler.Wrap;
|
2017-06-06 12:49:27 +02:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
function cef_render_handler_get_root_screen_rect(self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
rect : PCefRect): Integer; stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
Result := Ord(False);
|
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
Result := Ord(TCefRenderHandlerOwn(TempObject).GetRootScreenRect(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
rect^));
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-12-12 17:13:23 +01:00
|
|
|
|
procedure cef_render_handler_get_view_rect(self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
rect : PCefRect); stdcall;
|
2018-03-29 20:02:04 +02:00
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
2018-12-12 17:13:23 +01:00
|
|
|
|
TCefRenderHandlerOwn(TempObject).GetViewRect(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
rect^);
|
2019-01-20 09:50:32 +01:00
|
|
|
|
|
|
|
|
|
// CEF3 needs a rect with valid height and width
|
|
|
|
|
if (rect^.width <= 0) then rect^.width := 800;
|
|
|
|
|
if (rect^.height <= 0) then rect^.height := 600;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
function cef_render_handler_get_screen_point(self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
viewX, viewY : Integer;
|
|
|
|
|
screenX, screenY : PInteger): Integer; stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
Result := Ord(False);
|
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
Result := Ord(TCefRenderHandlerOwn(TempObject).GetScreenPoint(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
viewX,
|
|
|
|
|
viewY,
|
|
|
|
|
screenX^,
|
|
|
|
|
screenY^));
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
function cef_render_handler_get_screen_info(self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
screen_info : PCefScreenInfo): Integer; stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
Result := Ord(False);
|
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
Result := Ord(TCefRenderHandlerOwn(TempObject).GetScreenInfo(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
screen_info^));
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure cef_render_handler_on_popup_show(self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
show : Integer); stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
TCefRenderHandlerOwn(TempObject).OnPopupShow(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
show <> 0);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure cef_render_handler_on_popup_size( self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
const rect : PCefRect); stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
TCefRenderHandlerOwn(TempObject).OnPopupSize(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
rect);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure cef_render_handler_on_paint( self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
kind : TCefPaintElementType;
|
|
|
|
|
dirtyRectsCount : NativeUInt;
|
|
|
|
|
const dirtyRects : PCefRectArray;
|
|
|
|
|
const buffer : Pointer;
|
|
|
|
|
width : Integer;
|
|
|
|
|
height : Integer); stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
TCefRenderHandlerOwn(TempObject).OnPaint(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
kind,
|
|
|
|
|
dirtyRectsCount,
|
|
|
|
|
dirtyRects,
|
|
|
|
|
buffer,
|
|
|
|
|
width,
|
|
|
|
|
height);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-12-12 17:13:23 +01:00
|
|
|
|
procedure cef_render_handler_on_accelerated_paint( self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
kind : TCefPaintElementType;
|
|
|
|
|
dirtyRectsCount : NativeUInt;
|
|
|
|
|
const dirtyRects : PCefRectArray;
|
|
|
|
|
shared_handle : Pointer); stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
|
|
|
|
begin
|
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
TCefRenderHandlerOwn(TempObject).OnAcceleratedPaint(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
kind,
|
|
|
|
|
dirtyRectsCount,
|
|
|
|
|
dirtyRects,
|
|
|
|
|
shared_handle);
|
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure cef_render_handler_on_cursor_change( self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
cursor : TCefCursorHandle;
|
|
|
|
|
type_ : TCefCursorType;
|
|
|
|
|
const custom_cursor_info : PCefCursorInfo); stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
TCefRenderHandlerOwn(TempObject).OnCursorChange(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
cursor,
|
|
|
|
|
type_,
|
|
|
|
|
custom_cursor_info);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
function cef_render_handler_start_dragging(self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
drag_data : PCefDragData;
|
|
|
|
|
allowed_ops : TCefDragOperations;
|
|
|
|
|
x : Integer;
|
|
|
|
|
y : Integer): Integer; stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
Result := Ord(False);
|
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
Result := Ord(TCefRenderHandlerOwn(TempObject).OnStartDragging(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
TCefDragDataRef.UnWrap(drag_data),
|
|
|
|
|
allowed_ops,
|
|
|
|
|
x,
|
|
|
|
|
y));
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure cef_render_handler_update_drag_cursor(self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
operation : TCefDragOperation); stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
TCefRenderHandlerOwn(TempObject).OnUpdateDragCursor(TCefBrowserRef.UnWrap(browser), operation);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure cef_render_handler_on_scroll_offset_changed(self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
x : Double;
|
|
|
|
|
y : Double); stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
TCefRenderHandlerOwn(TempObject).OnScrollOffsetChanged(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
x,
|
|
|
|
|
y);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure cef_render_handler_on_ime_composition_range_changed( self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
const selected_range : PCefRange;
|
|
|
|
|
character_boundsCount : NativeUInt;
|
|
|
|
|
const character_bounds : PCefRect); stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
TCefRenderHandlerOwn(TempObject).OnIMECompositionRangeChanged(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
selected_range,
|
|
|
|
|
character_boundsCount,
|
|
|
|
|
character_bounds);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-04-20 12:45:06 +02:00
|
|
|
|
procedure cef_render_handler_on_text_selection_changed( self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
const selected_text : PCefString;
|
|
|
|
|
const selected_range : PCefRange); stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
|
|
|
|
begin
|
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
TCefRenderHandlerOwn(TempObject).OnTextSelectionChanged(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
CefString(selected_text),
|
|
|
|
|
selected_range);
|
|
|
|
|
end;
|
|
|
|
|
|
2019-03-15 17:17:14 +01:00
|
|
|
|
procedure cef_render_handler_on_virtual_keyboard_requested(self : PCefRenderHandler;
|
|
|
|
|
browser : PCefBrowser;
|
|
|
|
|
input_mode : TCefTextInpuMode); stdcall;
|
|
|
|
|
var
|
|
|
|
|
TempObject : TObject;
|
|
|
|
|
begin
|
|
|
|
|
TempObject := CefGetObject(self);
|
|
|
|
|
|
|
|
|
|
if (TempObject <> nil) and (TempObject is TCefRenderHandlerOwn) then
|
|
|
|
|
TCefRenderHandlerOwn(TempObject).OnVirtualKeyboardRequested(TCefBrowserRef.UnWrap(browser),
|
|
|
|
|
input_mode);
|
|
|
|
|
end;
|
|
|
|
|
|
2017-01-27 16:37:51 +01:00
|
|
|
|
constructor TCefRenderHandlerOwn.Create;
|
|
|
|
|
begin
|
2018-03-29 20:02:04 +02:00
|
|
|
|
inherited CreateData(SizeOf(TCefRenderHandler));
|
2017-01-27 16:37:51 +01:00
|
|
|
|
|
|
|
|
|
with PCefRenderHandler(FData)^ do
|
|
|
|
|
begin
|
2018-05-12 14:50:54 +02:00
|
|
|
|
get_accessibility_handler := {$IFDEF FPC}@{$ENDIF}cef_render_handler_get_accessibility_handler;
|
|
|
|
|
get_root_screen_rect := {$IFDEF FPC}@{$ENDIF}cef_render_handler_get_root_screen_rect;
|
|
|
|
|
get_view_rect := {$IFDEF FPC}@{$ENDIF}cef_render_handler_get_view_rect;
|
|
|
|
|
get_screen_point := {$IFDEF FPC}@{$ENDIF}cef_render_handler_get_screen_point;
|
|
|
|
|
get_screen_info := {$IFDEF FPC}@{$ENDIF}cef_render_handler_get_screen_info;
|
|
|
|
|
on_popup_show := {$IFDEF FPC}@{$ENDIF}cef_render_handler_on_popup_show;
|
|
|
|
|
on_popup_size := {$IFDEF FPC}@{$ENDIF}cef_render_handler_on_popup_size;
|
|
|
|
|
on_paint := {$IFDEF FPC}@{$ENDIF}cef_render_handler_on_paint;
|
2018-12-12 17:13:23 +01:00
|
|
|
|
on_accelerated_paint := {$IFDEF FPC}@{$ENDIF}cef_render_handler_on_accelerated_paint;
|
2018-05-12 14:50:54 +02:00
|
|
|
|
on_cursor_change := {$IFDEF FPC}@{$ENDIF}cef_render_handler_on_cursor_change;
|
|
|
|
|
start_dragging := {$IFDEF FPC}@{$ENDIF}cef_render_handler_start_dragging;
|
|
|
|
|
update_drag_cursor := {$IFDEF FPC}@{$ENDIF}cef_render_handler_update_drag_cursor;
|
|
|
|
|
on_scroll_offset_changed := {$IFDEF FPC}@{$ENDIF}cef_render_handler_on_scroll_offset_changed;
|
|
|
|
|
on_ime_composition_range_changed := {$IFDEF FPC}@{$ENDIF}cef_render_handler_on_ime_composition_range_changed;
|
|
|
|
|
on_text_selection_changed := {$IFDEF FPC}@{$ENDIF}cef_render_handler_on_text_selection_changed;
|
2019-03-15 17:17:14 +01:00
|
|
|
|
on_virtual_keyboard_requested := {$IFDEF FPC}@{$ENDIF}cef_render_handler_on_virtual_keyboard_requested;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2017-06-06 12:49:27 +02:00
|
|
|
|
procedure TCefRenderHandlerOwn.GetAccessibilityHandler(var aAccessibilityHandler : ICefAccessibilityHandler);
|
|
|
|
|
begin
|
|
|
|
|
aAccessibilityHandler := nil;
|
|
|
|
|
end;
|
|
|
|
|
|
2017-07-28 12:47:57 +02:00
|
|
|
|
function TCefRenderHandlerOwn.GetRootScreenRect(const browser: ICefBrowser; var rect: TCefRect): Boolean;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
|
|
|
|
Result := False;
|
|
|
|
|
end;
|
|
|
|
|
|
2017-07-28 12:47:57 +02:00
|
|
|
|
function TCefRenderHandlerOwn.GetScreenInfo(const browser: ICefBrowser; var screenInfo: TCefScreenInfo): Boolean;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
|
|
|
|
Result := False;
|
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
function TCefRenderHandlerOwn.GetScreenPoint(const browser: ICefBrowser; viewX, viewY: Integer; var screenX, screenY: Integer): Boolean;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
|
|
|
|
Result := False;
|
|
|
|
|
end;
|
|
|
|
|
|
2018-12-12 17:13:23 +01:00
|
|
|
|
procedure TCefRenderHandlerOwn.GetViewRect(const browser: ICefBrowser; var rect: TCefRect);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-12-12 17:13:23 +01:00
|
|
|
|
//
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure TCefRenderHandlerOwn.OnCursorChange(const browser: ICefBrowser; cursor: TCefCursorHandle; CursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-04-20 12:45:06 +02:00
|
|
|
|
//
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure TCefRenderHandlerOwn.OnPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-04-20 12:45:06 +02:00
|
|
|
|
//
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-12-12 17:13:23 +01:00
|
|
|
|
procedure TCefRenderHandlerOwn.OnAcceleratedPaint(const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; shared_handle: Pointer);
|
|
|
|
|
begin
|
|
|
|
|
//
|
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure TCefRenderHandlerOwn.OnPopupShow(const browser: ICefBrowser; show: Boolean);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-04-20 12:45:06 +02:00
|
|
|
|
//
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure TCefRenderHandlerOwn.OnPopupSize(const browser: ICefBrowser; const rect: PCefRect);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-04-20 12:45:06 +02:00
|
|
|
|
//
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure TCefRenderHandlerOwn.OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-04-20 12:45:06 +02:00
|
|
|
|
//
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TCefRenderHandlerOwn.OnIMECompositionRangeChanged(const browser : ICefBrowser;
|
|
|
|
|
const selected_range : PCefRange;
|
|
|
|
|
character_boundsCount : NativeUInt;
|
|
|
|
|
const character_bounds : PCefRect);
|
|
|
|
|
begin
|
2018-04-20 12:45:06 +02:00
|
|
|
|
//
|
|
|
|
|
end;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
|
2018-04-20 12:45:06 +02:00
|
|
|
|
procedure TCefRenderHandlerOwn.OnTextSelectionChanged(const browser : ICefBrowser;
|
|
|
|
|
const selected_text : ustring;
|
|
|
|
|
const selected_range : PCefRange);
|
|
|
|
|
begin
|
|
|
|
|
//
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2019-03-15 17:17:14 +01:00
|
|
|
|
procedure TCefRenderHandlerOwn.OnVirtualKeyboardRequested(const browser : ICefBrowser;
|
|
|
|
|
input_mode : TCefTextInpuMode);
|
|
|
|
|
begin
|
|
|
|
|
//
|
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
function TCefRenderHandlerOwn.OnStartDragging(const browser: ICefBrowser; const dragData: ICefDragData; allowedOps: TCefDragOperations; x, y: Integer): Boolean;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
|
|
|
|
Result := False;
|
|
|
|
|
end;
|
|
|
|
|
|
2018-03-29 20:02:04 +02:00
|
|
|
|
procedure TCefRenderHandlerOwn.OnUpdateDragCursor(const browser: ICefBrowser; operation: TCefDragOperation);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-04-20 12:45:06 +02:00
|
|
|
|
//
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-02-03 17:52:48 +01:00
|
|
|
|
procedure TCefRenderHandlerOwn.RemoveReferences;
|
|
|
|
|
begin
|
|
|
|
|
//
|
|
|
|
|
end;
|
|
|
|
|
|
2017-01-27 16:37:51 +01:00
|
|
|
|
// TCustomRenderHandler
|
|
|
|
|
|
2019-06-19 16:53:26 +02:00
|
|
|
|
constructor TCustomRenderHandler.Create(const events : IChromiumEvents);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
|
|
|
|
inherited Create;
|
2017-06-06 12:49:27 +02:00
|
|
|
|
|
2019-06-19 16:53:26 +02:00
|
|
|
|
FEvents := Pointer(events);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2017-06-11 17:48:20 +02:00
|
|
|
|
destructor TCustomRenderHandler.Destroy;
|
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
RemoveReferences;
|
2017-06-11 17:48:20 +02:00
|
|
|
|
|
|
|
|
|
inherited Destroy;
|
|
|
|
|
end;
|
|
|
|
|
|
2018-02-03 17:52:48 +01:00
|
|
|
|
procedure TCustomRenderHandler.RemoveReferences;
|
|
|
|
|
begin
|
|
|
|
|
FEvents := nil;
|
|
|
|
|
end;
|
|
|
|
|
|
2017-06-06 12:49:27 +02:00
|
|
|
|
procedure TCustomRenderHandler.GetAccessibilityHandler(var aAccessibilityHandler : ICefAccessibilityHandler);
|
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnGetAccessibilityHandler(aAccessibilityHandler);
|
2017-06-06 12:49:27 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2017-07-28 12:47:57 +02:00
|
|
|
|
function TCustomRenderHandler.GetRootScreenRect(const browser: ICefBrowser; var rect: TCefRect): Boolean;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then
|
|
|
|
|
Result := IChromiumEvents(FEvents).doOnGetRootScreenRect(browser, rect)
|
2017-06-11 17:48:20 +02:00
|
|
|
|
else
|
2017-06-11 20:36:14 +02:00
|
|
|
|
Result := inherited GetRootScreenRect(browser, rect);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2017-07-28 12:47:57 +02:00
|
|
|
|
function TCustomRenderHandler.GetScreenInfo(const browser: ICefBrowser; var screenInfo: TCefScreenInfo): Boolean;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then
|
|
|
|
|
Result := IChromiumEvents(FEvents).doOnGetScreenInfo(browser, screenInfo)
|
2017-06-11 17:48:20 +02:00
|
|
|
|
else
|
2017-06-11 20:36:14 +02:00
|
|
|
|
Result := inherited GetScreenInfo(browser, screenInfo);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2017-07-28 12:47:57 +02:00
|
|
|
|
function TCustomRenderHandler.GetScreenPoint(const browser: ICefBrowser; viewX, viewY: Integer; var screenX, screenY: Integer): Boolean;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then
|
|
|
|
|
Result := IChromiumEvents(FEvents).doOnGetScreenPoint(browser, viewX, viewY, screenX, screenY)
|
2017-06-11 17:48:20 +02:00
|
|
|
|
else
|
2017-06-11 20:36:14 +02:00
|
|
|
|
Result := inherited GetScreenPoint(browser, viewX, viewY, screenX, screenY);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-12-12 17:13:23 +01:00
|
|
|
|
procedure TCustomRenderHandler.GetViewRect(const browser: ICefBrowser; var rect: TCefRect);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then
|
2018-12-12 17:13:23 +01:00
|
|
|
|
IChromiumEvents(FEvents).doOnGetViewRect(browser, rect)
|
2017-06-11 17:48:20 +02:00
|
|
|
|
else
|
2018-12-12 17:13:23 +01:00
|
|
|
|
inherited GetViewRect(browser, rect);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2017-06-11 20:36:14 +02:00
|
|
|
|
procedure TCustomRenderHandler.OnCursorChange(const browser : ICefBrowser;
|
|
|
|
|
cursor : TCefCursorHandle;
|
|
|
|
|
cursorType : TCefCursorType;
|
|
|
|
|
const customCursorInfo : PCefCursorInfo);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnCursorChange(browser, cursor, cursorType, customCursorInfo);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2017-06-11 20:36:14 +02:00
|
|
|
|
procedure TCustomRenderHandler.OnPaint(const browser : ICefBrowser;
|
|
|
|
|
kind : TCefPaintElementType;
|
|
|
|
|
dirtyRectsCount : NativeUInt;
|
|
|
|
|
const dirtyRects : PCefRectArray;
|
|
|
|
|
const buffer : Pointer;
|
|
|
|
|
width : Integer;
|
|
|
|
|
height : Integer);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnPaint(browser, kind, dirtyRectsCount, dirtyRects, buffer, width, height);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-12-12 17:13:23 +01:00
|
|
|
|
procedure TCustomRenderHandler.OnAcceleratedPaint(const browser : ICefBrowser;
|
|
|
|
|
kind : TCefPaintElementType;
|
|
|
|
|
dirtyRectsCount : NativeUInt;
|
|
|
|
|
const dirtyRects : PCefRectArray;
|
|
|
|
|
shared_handle : Pointer);
|
|
|
|
|
begin
|
|
|
|
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnAcceleratedPaint(browser, kind, dirtyRectsCount, dirtyRects, shared_handle);
|
|
|
|
|
end;
|
|
|
|
|
|
2017-06-11 20:36:14 +02:00
|
|
|
|
procedure TCustomRenderHandler.OnPopupShow(const browser: ICefBrowser; show: Boolean);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnPopupShow(browser, show);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2017-06-11 20:36:14 +02:00
|
|
|
|
procedure TCustomRenderHandler.OnPopupSize(const browser: ICefBrowser; const rect: PCefRect);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnPopupSize(browser, rect);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2017-06-11 20:36:14 +02:00
|
|
|
|
procedure TCustomRenderHandler.OnScrollOffsetChanged(const browser: ICefBrowser; x, y: Double);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnScrollOffsetChanged(browser, x, y);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2017-06-11 20:36:14 +02:00
|
|
|
|
procedure TCustomRenderHandler.OnIMECompositionRangeChanged(const browser : ICefBrowser;
|
|
|
|
|
const selected_range : PCefRange;
|
|
|
|
|
character_boundsCount : NativeUInt;
|
|
|
|
|
const character_bounds : PCefRect);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnIMECompositionRangeChanged(browser, selected_range, character_boundsCount, character_bounds);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2018-04-20 12:45:06 +02:00
|
|
|
|
procedure TCustomRenderHandler.OnTextSelectionChanged(const browser : ICefBrowser;
|
|
|
|
|
const selected_text : ustring;
|
|
|
|
|
const selected_range : PCefRange);
|
|
|
|
|
begin
|
|
|
|
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnTextSelectionChanged(browser, selected_text, selected_range);
|
|
|
|
|
end;
|
|
|
|
|
|
2019-03-15 17:17:14 +01:00
|
|
|
|
procedure TCustomRenderHandler.OnVirtualKeyboardRequested(const browser : ICefBrowser;
|
|
|
|
|
input_mode : TCefTextInpuMode);
|
|
|
|
|
begin
|
|
|
|
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnVirtualKeyboardRequested(browser, input_mode);
|
|
|
|
|
end;
|
|
|
|
|
|
2017-06-11 20:36:14 +02:00
|
|
|
|
function TCustomRenderHandler.OnStartDragging(const browser : ICefBrowser;
|
|
|
|
|
const dragData : ICefDragData;
|
|
|
|
|
allowedOps : TCefDragOperations;
|
|
|
|
|
x : Integer;
|
|
|
|
|
y : Integer): Boolean;
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then
|
|
|
|
|
Result := IChromiumEvents(FEvents).doOnStartDragging(browser, dragData, allowedOps, x, y)
|
2017-06-11 17:48:20 +02:00
|
|
|
|
else
|
2017-06-11 20:36:14 +02:00
|
|
|
|
Result := inherited OnStartDragging(browser, dragData, allowedOps, x, y);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2017-06-11 20:36:14 +02:00
|
|
|
|
procedure TCustomRenderHandler.OnUpdateDragCursor(const browser: ICefBrowser; operation: TCefDragOperation);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
begin
|
2018-02-03 17:52:48 +01:00
|
|
|
|
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnUpdateDragCursor(browser, operation);
|
2017-01-27 16:37:51 +01:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|