You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-12 22:07:39 +02:00
Geolocation demo
This commit is contained in:
@ -52,7 +52,7 @@ uses
|
||||
{$ELSE}
|
||||
Windows, Classes, SysUtils, Controls, ActiveX, Math,
|
||||
{$ENDIF}
|
||||
uCEFTypes, uCEFInterfaces, uCEFLibFunctions, uCEFResourceHandler;
|
||||
uCEFTypes, uCEFInterfaces, uCEFLibFunctions, uCEFResourceHandler, uCEFGetGeolocationCallback;
|
||||
|
||||
const
|
||||
Kernel32DLL = 'kernel32.dll';
|
||||
@ -184,10 +184,13 @@ procedure LogicalToDevice(var aRect : TCEFRect; const aDeviceScaleFactor : doubl
|
||||
function GetScreenDPI : integer;
|
||||
function GetDeviceScaleFactor : single;
|
||||
|
||||
function CefGetGeolocation(const aCallbackFunction : TOnLocationUpdate) : boolean;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
uCEFConstants, uCEFApplication, uCEFSchemeHandlerFactory, uCEFValue, uCEFBinaryValue;
|
||||
uCEFConstants, uCEFApplication, uCEFSchemeHandlerFactory, uCEFValue,
|
||||
uCEFBinaryValue;
|
||||
|
||||
function CefColorGetA(color: TCefColor): Byte;
|
||||
begin
|
||||
@ -1006,6 +1009,14 @@ begin
|
||||
cef_load_crlsets_file(@TempPath);
|
||||
end;
|
||||
|
||||
function CefGetGeolocation(const aCallbackFunction : TOnLocationUpdate) : boolean;
|
||||
var
|
||||
TempGeoCallBack : ICefGetGeolocationCallback;
|
||||
begin
|
||||
TempGeoCallBack := TCefFastGetGeolocationCallback.Create(aCallbackFunction);
|
||||
Result := (cef_get_geolocation(TempGeoCallBack.Wrap) <> 0);
|
||||
end;
|
||||
|
||||
function CefIsKeyDown(aWparam : WPARAM) : boolean;
|
||||
begin
|
||||
Result := (GetKeyState(aWparam) < 0);
|
||||
|
Reference in New Issue
Block a user