You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-12 22:07:39 +02:00
Added support for Lazarus/FPC (windows 32bit)
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
// For more information about CEF4Delphi visit :
|
||||
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||
//
|
||||
// Copyright � 2018 Salvador D�az Fau. All rights reserved.
|
||||
// Copyright � 2018 Salvador Diaz Fau. All rights reserved.
|
||||
//
|
||||
// ************************************************************************
|
||||
// ************ vvvv Original license and comments below vvvv *************
|
||||
@ -69,15 +69,15 @@ type
|
||||
FDefaultEncoding : ustring;
|
||||
FProxyType : integer;
|
||||
FProxyScheme : TCefProxyScheme;
|
||||
FProxyServer : string;
|
||||
FProxyServer : ustring;
|
||||
FProxyPort : integer;
|
||||
FProxyUsername : string;
|
||||
FProxyPassword : string;
|
||||
FProxyScriptURL : string;
|
||||
FProxyByPassList : string;
|
||||
FProxyUsername : ustring;
|
||||
FProxyPassword : ustring;
|
||||
FProxyScriptURL : ustring;
|
||||
FProxyByPassList : ustring;
|
||||
FUpdatePreferences : boolean;
|
||||
FCustomHeaderName : string;
|
||||
FCustomHeaderValue : string;
|
||||
FCustomHeaderName : ustring;
|
||||
FCustomHeaderValue : ustring;
|
||||
FAddCustomHeader : boolean;
|
||||
FDoNotTrack : boolean;
|
||||
FSendReferrer : boolean;
|
||||
@ -88,7 +88,6 @@ type
|
||||
FCookiePrefs : integer;
|
||||
FImagesPrefs : integer;
|
||||
FZoomStep : byte;
|
||||
FWindowName : string;
|
||||
FPrefsFileName : string;
|
||||
FIsOSR : boolean;
|
||||
FInitialized : boolean;
|
||||
@ -230,7 +229,7 @@ type
|
||||
function GetHasBrowser : boolean;
|
||||
function GetCanGoBack : boolean;
|
||||
function GetCanGoForward : boolean;
|
||||
function GetDocumentURL : string;
|
||||
function GetDocumentURL : ustring;
|
||||
function GetZoomLevel : double;
|
||||
function GetZoomPct : double;
|
||||
function GetIsPopUp : boolean;
|
||||
@ -241,7 +240,7 @@ type
|
||||
function GetVisibleNavigationEntry : ICefNavigationEntry;
|
||||
function GetHasValidMainFrame : boolean;
|
||||
function GetFrameCount : NativeUInt;
|
||||
function GetRequestContextCache : string;
|
||||
function GetRequestContextCache : ustring;
|
||||
function GetRequestContextIsGlobal : boolean;
|
||||
|
||||
procedure SetDoNotTrack(aValue : boolean);
|
||||
@ -257,14 +256,14 @@ type
|
||||
procedure SetImagesPrefs(aValue : integer);
|
||||
procedure SetProxyType(aValue : integer);
|
||||
procedure SetProxyScheme(aValue : TCefProxyScheme);
|
||||
procedure SetProxyServer(const aValue : string);
|
||||
procedure SetProxyServer(const aValue : ustring);
|
||||
procedure SetProxyPort(aValue : integer);
|
||||
procedure SetProxyUsername(const aValue : string);
|
||||
procedure SetProxyPassword(const aValue : string);
|
||||
procedure SetProxyScriptURL(const aValue : string);
|
||||
procedure SetProxyByPassList(const aValue : string);
|
||||
procedure SetCustomHeaderName(const aValue : string);
|
||||
procedure SetCustomHeaderValue(const aValue : string);
|
||||
procedure SetProxyUsername(const aValue : ustring);
|
||||
procedure SetProxyPassword(const aValue : ustring);
|
||||
procedure SetProxyScriptURL(const aValue : ustring);
|
||||
procedure SetProxyByPassList(const aValue : ustring);
|
||||
procedure SetCustomHeaderName(const aValue : ustring);
|
||||
procedure SetCustomHeaderValue(const aValue : ustring);
|
||||
procedure SetZoomLevel(const aValue : double);
|
||||
procedure SetZoomPct(const aValue : double);
|
||||
procedure SetZoomStep(aValue : byte);
|
||||
@ -281,13 +280,13 @@ type
|
||||
procedure InitializeEvents;
|
||||
procedure InitializeSettings(var aSettings : TCefBrowserSettings);
|
||||
|
||||
procedure GetPrintPDFSettings(var aSettings : TCefPdfPrintSettings; const aTitle, aURL : string);
|
||||
procedure GetPrintPDFSettings(var aSettings : TCefPdfPrintSettings; const aTitle, aURL : ustring);
|
||||
|
||||
function UpdateProxyPrefs(const aBrowser: ICefBrowser) : boolean;
|
||||
function UpdatePreference(const aBrowser: ICefBrowser; const aName : string; aValue : boolean) : boolean; overload;
|
||||
function UpdatePreference(const aBrowser: ICefBrowser; const aName : string; aValue : integer) : boolean; overload;
|
||||
function UpdatePreference(const aBrowser: ICefBrowser; const aName : string; const aValue : double) : boolean; overload;
|
||||
function UpdatePreference(const aBrowser: ICefBrowser; const aName, aValue : string) : boolean; overload;
|
||||
function UpdatePreference(const aBrowser: ICefBrowser; const aName : ustring; aValue : boolean) : boolean; overload;
|
||||
function UpdatePreference(const aBrowser: ICefBrowser; const aName : ustring; aValue : integer) : boolean; overload;
|
||||
function UpdatePreference(const aBrowser: ICefBrowser; const aName : ustring; const aValue : double) : boolean; overload;
|
||||
function UpdatePreference(const aBrowser: ICefBrowser; const aName, aValue : ustring) : boolean; overload;
|
||||
|
||||
procedure HandleDictionary(const aDict : ICefDictionaryValue; var aResultSL : TStringList; const aRoot : string);
|
||||
procedure HandleNull(const aValue : ICefValue; var aResultSL : TStringList; const aRoot, aKey : string);
|
||||
@ -424,7 +423,7 @@ type
|
||||
// Custom
|
||||
procedure doCookiesDeleted(numDeleted : integer); virtual;
|
||||
procedure doPdfPrintFinished(aResultOK : boolean); virtual;
|
||||
procedure doTextResultAvailable(const aText : string); virtual;
|
||||
procedure doTextResultAvailable(const aText : ustring); virtual;
|
||||
procedure doUpdatePreferences(const aBrowser: ICefBrowser); virtual;
|
||||
procedure doUpdateOwnPreferences; virtual;
|
||||
function doSavePreferences : boolean; virtual;
|
||||
@ -439,9 +438,9 @@ type
|
||||
function CreateClientHandler(var aClient : ICefClient; aIsOSR : boolean = True) : boolean; overload;
|
||||
procedure CloseBrowser(aForceClose : boolean);
|
||||
function ShareRequestContext(var aContext : ICefRequestContext; const aHandler : ICefRequestContextHandler = nil) : boolean;
|
||||
function CreateBrowser(const aWindowName : string = ''; const aContext : ICefRequestContext = nil; const aCookiesPath : string = ''; aPersistSessionCookies : boolean = False) : boolean; overload; virtual;
|
||||
function CreateBrowser(const aWindowName : ustring = ''; const aContext : ICefRequestContext = nil; const aCookiesPath : ustring = ''; aPersistSessionCookies : boolean = False) : boolean; overload; virtual;
|
||||
{$IFDEF MSWINDOWS}
|
||||
function CreateBrowser(aParentHandle : HWND; aParentRect : TRect; const aWindowName : string = ''; const aContext : ICefRequestContext = nil; const aCookiesPath : string = ''; aPersistSessionCookies : boolean = False) : boolean; overload; virtual;
|
||||
function CreateBrowser(aParentHandle : HWND; aParentRect : TRect; const aWindowName : ustring = ''; const aContext : ICefRequestContext = nil; const aCookiesPath : ustring = ''; aPersistSessionCookies : boolean = False) : boolean; overload; virtual;
|
||||
{$ENDIF}
|
||||
|
||||
procedure LoadURL(const aURL : ustring);
|
||||
@ -547,18 +546,17 @@ type
|
||||
property RenderHandle : THandle read FRenderCompHWND;
|
||||
property FrameIsFocused : boolean read GetFrameIsFocused;
|
||||
property Initialized : boolean read GetInitialized;
|
||||
property RequestContextCache : string read GetRequestContextCache;
|
||||
property RequestContextCache : ustring read GetRequestContextCache;
|
||||
property RequestContextIsGlobal : boolean read GetRequestContextIsGlobal;
|
||||
property CookiePrefs : integer read FCookiePrefs write SetCookiePrefs;
|
||||
property ImagesPrefs : integer read FImagesPrefs write SetImagesPrefs;
|
||||
property DocumentURL : string read GetDocumentURL;
|
||||
property WindowName : string read FWindowName write FWindowName;
|
||||
property DocumentURL : ustring read GetDocumentURL;
|
||||
property ZoomLevel : double read GetZoomLevel write SetZoomLevel;
|
||||
property ZoomPct : double read GetZoomPct write SetZoomPct;
|
||||
property ZoomStep : byte read FZoomStep write SetZoomStep;
|
||||
property WindowlessFrameRate : integer read GetWindowlessFrameRate write SetWindowlessFrameRate;
|
||||
property CustomHeaderName : string read FCustomHeaderName write SetCustomHeaderName;
|
||||
property CustomHeaderValue : string read FCustomHeaderValue write SetCustomHeaderValue;
|
||||
property CustomHeaderName : ustring read FCustomHeaderName write SetCustomHeaderName;
|
||||
property CustomHeaderValue : ustring read FCustomHeaderValue write SetCustomHeaderValue;
|
||||
property DoNotTrack : boolean read FDoNotTrack write SetDoNotTrack;
|
||||
property SendReferrer : boolean read FSendReferrer write SetSendReferrer;
|
||||
property HyperlinkAuditing : boolean read FHyperlinkAuditing write SetHyperlinkAuditing;
|
||||
@ -575,12 +573,12 @@ type
|
||||
|
||||
property ProxyType : integer read FProxyType write SetProxyType;
|
||||
property ProxyScheme : TCefProxyScheme read FProxyScheme write SetProxyScheme;
|
||||
property ProxyServer : string read FProxyServer write SetProxyServer;
|
||||
property ProxyServer : ustring read FProxyServer write SetProxyServer;
|
||||
property ProxyPort : integer read FProxyPort write SetProxyPort;
|
||||
property ProxyUsername : string read FProxyUsername write SetProxyUsername;
|
||||
property ProxyPassword : string read FProxyPassword write SetProxyPassword;
|
||||
property ProxyScriptURL : string read FProxyScriptURL write SetProxyScriptURL;
|
||||
property ProxyByPassList : string read FProxyByPassList write SetProxyByPassList;
|
||||
property ProxyUsername : ustring read FProxyUsername write SetProxyUsername;
|
||||
property ProxyPassword : ustring read FProxyPassword write SetProxyPassword;
|
||||
property ProxyScriptURL : ustring read FProxyScriptURL write SetProxyScriptURL;
|
||||
property ProxyByPassList : ustring read FProxyByPassList write SetProxyByPassList;
|
||||
|
||||
published
|
||||
property OnTextResultAvailable : TOnTextResultAvailableEvent read FOnTextResultAvailable write FOnTextResultAvailable;
|
||||
@ -725,7 +723,6 @@ begin
|
||||
FCookiePrefs := CEF_CONTENT_SETTING_ALLOW;
|
||||
FImagesPrefs := CEF_CONTENT_SETTING_ALLOW;
|
||||
FZoomStep := ZOOM_STEP_DEF;
|
||||
FWindowName := '';
|
||||
|
||||
{$IFDEF MSWINDOWS}
|
||||
FOldBrowserCompWndPrc := nil;
|
||||
@ -997,9 +994,9 @@ begin
|
||||
FOnResolvedHostAvailable := nil;
|
||||
end;
|
||||
|
||||
function TFMXChromium.CreateBrowser(const aWindowName : string;
|
||||
function TFMXChromium.CreateBrowser(const aWindowName : ustring;
|
||||
const aContext : ICefRequestContext;
|
||||
const aCookiesPath : string;
|
||||
const aCookiesPath : ustring;
|
||||
aPersistSessionCookies : boolean) : boolean;
|
||||
var
|
||||
TempCookieManager : ICefCookieManager;
|
||||
@ -1049,9 +1046,9 @@ end;
|
||||
{$IFDEF MSWINDOWS}
|
||||
function TFMXChromium.CreateBrowser( aParentHandle : HWND;
|
||||
aParentRect : TRect;
|
||||
const aWindowName : string;
|
||||
const aWindowName : ustring;
|
||||
const aContext : ICefRequestContext;
|
||||
const aCookiesPath : string;
|
||||
const aCookiesPath : ustring;
|
||||
aPersistSessionCookies : boolean) : boolean;
|
||||
var
|
||||
TempCookieManager : ICefCookieManager;
|
||||
@ -1272,7 +1269,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFMXChromium.GetPrintPDFSettings(var aSettings : TCefPdfPrintSettings; const aTitle, aURL : string);
|
||||
procedure TFMXChromium.GetPrintPDFSettings(var aSettings : TCefPdfPrintSettings; const aTitle, aURL : ustring);
|
||||
begin
|
||||
if (FPDFPrintOptions <> nil) then
|
||||
begin
|
||||
@ -1508,7 +1505,7 @@ begin
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function TFMXChromium.GetRequestContextCache : string;
|
||||
function TFMXChromium.GetRequestContextCache : ustring;
|
||||
begin
|
||||
if Initialized then
|
||||
Result := FBrowser.host.RequestContext.CachePath
|
||||
@ -1549,7 +1546,7 @@ begin
|
||||
Result := FInitialized and not(FClosing) and (FBrowser <> nil);
|
||||
end;
|
||||
|
||||
function TFMXChromium.GetDocumentURL : string;
|
||||
function TFMXChromium.GetDocumentURL : ustring;
|
||||
var
|
||||
TempFrame : ICefFrame;
|
||||
begin
|
||||
@ -1755,7 +1752,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFMXChromium.SetProxyServer(const aValue : string);
|
||||
procedure TFMXChromium.SetProxyServer(const aValue : ustring);
|
||||
begin
|
||||
if (FProxyServer <> aValue) then
|
||||
begin
|
||||
@ -1773,7 +1770,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFMXChromium.SetProxyUsername(const aValue : string);
|
||||
procedure TFMXChromium.SetProxyUsername(const aValue : ustring);
|
||||
begin
|
||||
if (FProxyUsername <> aValue) then
|
||||
begin
|
||||
@ -1782,7 +1779,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFMXChromium.SetProxyPassword(const aValue : string);
|
||||
procedure TFMXChromium.SetProxyPassword(const aValue : ustring);
|
||||
begin
|
||||
if (FProxyPassword <> aValue) then
|
||||
begin
|
||||
@ -1791,7 +1788,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFMXChromium.SetProxyScriptURL(const aValue : string);
|
||||
procedure TFMXChromium.SetProxyScriptURL(const aValue : ustring);
|
||||
begin
|
||||
if (FProxyScriptURL <> aValue) then
|
||||
begin
|
||||
@ -1800,7 +1797,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFMXChromium.SetProxyByPassList(const aValue : string);
|
||||
procedure TFMXChromium.SetProxyByPassList(const aValue : ustring);
|
||||
begin
|
||||
if (FProxyByPassList <> aValue) then
|
||||
begin
|
||||
@ -1809,7 +1806,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFMXChromium.SetCustomHeaderName(const aValue : string);
|
||||
procedure TFMXChromium.SetCustomHeaderName(const aValue : ustring);
|
||||
begin
|
||||
if (FCustomHeaderName <> aValue) then
|
||||
begin
|
||||
@ -1818,7 +1815,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFMXChromium.SetCustomHeaderValue(const aValue : string);
|
||||
procedure TFMXChromium.SetCustomHeaderValue(const aValue : ustring);
|
||||
begin
|
||||
if (FCustomHeaderValue <> aValue) then
|
||||
begin
|
||||
@ -2122,7 +2119,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFMXChromium.UpdatePreference(const aBrowser: ICefBrowser; const aName : string; aValue : boolean) : boolean;
|
||||
function TFMXChromium.UpdatePreference(const aBrowser: ICefBrowser; const aName : ustring; aValue : boolean) : boolean;
|
||||
var
|
||||
TempError : ustring;
|
||||
TempValue : ICefValue;
|
||||
@ -2152,7 +2149,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFMXChromium.UpdatePreference(const aBrowser: ICefBrowser; const aName : string; aValue : integer) : boolean;
|
||||
function TFMXChromium.UpdatePreference(const aBrowser: ICefBrowser; const aName : ustring; aValue : integer) : boolean;
|
||||
var
|
||||
TempError : ustring;
|
||||
TempValue : ICefValue;
|
||||
@ -2177,7 +2174,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFMXChromium.UpdatePreference(const aBrowser: ICefBrowser; const aName : string; const aValue : double) : boolean;
|
||||
function TFMXChromium.UpdatePreference(const aBrowser: ICefBrowser; const aName : ustring; const aValue : double) : boolean;
|
||||
var
|
||||
TempError : ustring;
|
||||
TempValue : ICefValue;
|
||||
@ -2202,7 +2199,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFMXChromium.UpdatePreference(const aBrowser: ICefBrowser; const aName, aValue : string) : boolean;
|
||||
function TFMXChromium.UpdatePreference(const aBrowser: ICefBrowser; const aName, aValue : ustring) : boolean;
|
||||
var
|
||||
TempError : ustring;
|
||||
TempValue : ICefValue;
|
||||
@ -2558,7 +2555,7 @@ begin
|
||||
Result := assigned(FOnFindResult);
|
||||
end;
|
||||
|
||||
procedure TFMXChromium.doTextResultAvailable(const aText : string);
|
||||
procedure TFMXChromium.doTextResultAvailable(const aText : ustring);
|
||||
begin
|
||||
if assigned(FOnTextResultAvailable) then FOnTextResultAvailable(self, aText);
|
||||
end;
|
||||
|
Reference in New Issue
Block a user