1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2024-11-24 08:02:15 +02:00

Merge pull request #241 from ahausladen/CEFChromiumCore

Combine FMX and VCL/LCL Chromium units

Great job Andreas!
Thanks a million!
This commit is contained in:
Salvador Díaz Fau 2019-11-11 11:24:19 +01:00 committed by GitHub
commit 7ebcdf086a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 5464 additions and 9588 deletions

View File

@ -198,6 +198,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
Top = 0
Width = 25
Caption = '►'
Default = True
Font.CharSet = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -17
@ -244,6 +245,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
OnNavigationVisitorResultAvailable = Chromium1NavigationVisitorResultAvailable
OnDownloadImageFinished = Chromium1DownloadImageFinished
OnCookiesFlushed = Chromium1CookiesFlushed
OnRenderCompMsg = Chromium1RenderCompMsg
OnLoadEnd = Chromium1LoadEnd
OnLoadError = Chromium1LoadError
OnLoadingStateChange = Chromium1LoadingStateChange

View File

@ -22,7 +22,7 @@ package CEF4Delphi;
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$IMAGEBASE $54C00000}
{$DEFINE DEBUG}
{$ENDIF IMPLICITBUILDING}
{$DESCRIPTION 'CEF4Delphi'}
@ -102,7 +102,7 @@ contains
uCEFZipReader in '..\source\uCEFZipReader.pas',
uCEFResponse in '..\source\uCEFResponse.pas',
uCEFCookieVisitor in '..\source\uCEFCookieVisitor.pas',
uCEFV8Exception in '..\source\uCEFV8Exception.pas',
uCEFv8Exception in '..\source\uCEFv8Exception.pas',
uCEFResourceBundleHandler in '..\source\uCEFResourceBundleHandler.pas',
uCEFSetCookieCallback in '..\source\uCEFSetCookieCallback.pas',
uCEFDeleteCookiesCallback in '..\source\uCEFDeleteCookiesCallback.pas',
@ -131,6 +131,7 @@ contains
uCEFImage in '..\source\uCEFImage.pas',
uCEFMenuModelDelegate in '..\source\uCEFMenuModelDelegate.pas',
uCEFWindowParent in '..\source\uCEFWindowParent.pas',
uCEFChromiumCore in '..\source\uCEFChromiumCore.pas',
uCEFChromium in '..\source\uCEFChromium.pas',
uCEFChromiumEvents in '..\source\uCEFChromiumEvents.pas',
uCEFChromiumOptions in '..\source\uCEFChromiumOptions.pas',

View File

@ -196,7 +196,7 @@
<DCCReference Include="..\source\uCEFZipReader.pas"/>
<DCCReference Include="..\source\uCEFResponse.pas"/>
<DCCReference Include="..\source\uCEFCookieVisitor.pas"/>
<DCCReference Include="..\source\uCEFV8Exception.pas"/>
<DCCReference Include="..\source\uCEFv8Exception.pas"/>
<DCCReference Include="..\source\uCEFResourceBundleHandler.pas"/>
<DCCReference Include="..\source\uCEFSetCookieCallback.pas"/>
<DCCReference Include="..\source\uCEFDeleteCookiesCallback.pas"/>
@ -225,6 +225,7 @@
<DCCReference Include="..\source\uCEFImage.pas"/>
<DCCReference Include="..\source\uCEFMenuModelDelegate.pas"/>
<DCCReference Include="..\source\uCEFWindowParent.pas"/>
<DCCReference Include="..\source\uCEFChromiumCore.pas"/>
<DCCReference Include="..\source\uCEFChromium.pas"/>
<DCCReference Include="..\source\uCEFChromiumEvents.pas"/>
<DCCReference Include="..\source\uCEFChromiumOptions.pas"/>

View File

@ -30,7 +30,7 @@
-W+
-M
-$M16384,1048576
-K$00400000
-K$54C00000
-N"dcu\"
-LE"c:\program files\borland\delphi7\Projects\Bpl"
-LN"c:\program files\borland\delphi7\Projects\Bpl"

View File

@ -21,7 +21,7 @@ package CEF4Delphi_D7;
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$IMAGEBASE $54C00000}
{$DESCRIPTION 'CEF4Delphi'}
{$IMPLICITBUILD OFF}
{$DEFINE DEBUG}
@ -100,7 +100,7 @@ contains
uCEFZipReader in '..\source\uCEFZipReader.pas',
uCEFResponse in '..\source\uCEFResponse.pas',
uCEFCookieVisitor in '..\source\uCEFCookieVisitor.pas',
uCEFV8Exception in '..\source\uCEFV8Exception.pas',
uCEFv8Exception in '..\source\uCEFv8Exception.pas',
uCEFResourceBundleHandler in '..\source\uCEFResourceBundleHandler.pas',
uCEFSetCookieCallback in '..\source\uCEFSetCookieCallback.pas',
uCEFDeleteCookiesCallback in '..\source\uCEFDeleteCookiesCallback.pas',
@ -130,6 +130,7 @@ contains
uCEFMenuModelDelegate in '..\source\uCEFMenuModelDelegate.pas',
uCEFWindowParent in '..\source\uCEFWindowParent.pas',
uCEFChromium in '..\source\uCEFChromium.pas',
uCEFChromiumCore in '..\source\uCEFChromiumCore.pas',
uCEFChromiumEvents in '..\source\uCEFChromiumEvents.pas',
uCEFChromiumOptions in '..\source\uCEFChromiumOptions.pas',
uCEFChromiumFontOptions in '..\source\uCEFChromiumFontOptions.pas',

View File

@ -22,7 +22,7 @@ package CEF4Delphi_FMX;
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$IMAGEBASE $54C00000}
{$DEFINE $(FrameworkType)}
{$ENDIF IMPLICITBUILDING}
{$DESCRIPTION 'CEF4Delphi'}
@ -103,7 +103,7 @@ contains
uCEFZipReader in '..\source\uCEFZipReader.pas',
uCEFResponse in '..\source\uCEFResponse.pas',
uCEFCookieVisitor in '..\source\uCEFCookieVisitor.pas',
uCEFV8Exception in '..\source\uCEFV8Exception.pas',
uCEFv8Exception in '..\source\uCEFv8Exception.pas',
uCEFResourceBundleHandler in '..\source\uCEFResourceBundleHandler.pas',
uCEFSetCookieCallback in '..\source\uCEFSetCookieCallback.pas',
uCEFDeleteCookiesCallback in '..\source\uCEFDeleteCookiesCallback.pas',
@ -132,6 +132,7 @@ contains
uCEFImage in '..\source\uCEFImage.pas',
uCEFMenuModelDelegate in '..\source\uCEFMenuModelDelegate.pas',
uCEFWindowParent in '..\source\uCEFWindowParent.pas',
uCEFChromiumCore in '..\source\uCEFChromiumCore.pas',
uCEFChromium in '..\source\uCEFChromium.pas',
uCEFChromiumEvents in '..\source\uCEFChromiumEvents.pas',
uCEFChromiumOptions in '..\source\uCEFChromiumOptions.pas',

View File

@ -218,7 +218,7 @@
<DCCReference Include="..\source\uCEFZipReader.pas"/>
<DCCReference Include="..\source\uCEFResponse.pas"/>
<DCCReference Include="..\source\uCEFCookieVisitor.pas"/>
<DCCReference Include="..\source\uCEFV8Exception.pas"/>
<DCCReference Include="..\source\uCEFv8Exception.pas"/>
<DCCReference Include="..\source\uCEFResourceBundleHandler.pas"/>
<DCCReference Include="..\source\uCEFSetCookieCallback.pas"/>
<DCCReference Include="..\source\uCEFDeleteCookiesCallback.pas"/>
@ -247,6 +247,7 @@
<DCCReference Include="..\source\uCEFImage.pas"/>
<DCCReference Include="..\source\uCEFMenuModelDelegate.pas"/>
<DCCReference Include="..\source\uCEFWindowParent.pas"/>
<DCCReference Include="..\source\uCEFChromiumCore.pas"/>
<DCCReference Include="..\source\uCEFChromium.pas"/>
<DCCReference Include="..\source\uCEFChromiumEvents.pas"/>
<DCCReference Include="..\source\uCEFChromiumOptions.pas"/>

View File

@ -22,7 +22,7 @@
<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"/>
<Version Major="78" Minor="3" Release="1"/>
<Files Count="145">
<Files Count="146">
<Item1>
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
<UnitName Value="uCEFAccessibilityHandler"/>
@ -433,8 +433,8 @@
<UnitName Value="uCEFv8Context"/>
</Item102>
<Item103>
<Filename Value="..\source\uCEFV8Exception.pas"/>
<UnitName Value="uCEFV8Exception"/>
<Filename Value="..\source\uCEFv8Exception.pas"/>
<UnitName Value="uCEFv8Exception"/>
</Item103>
<Item104>
<Filename Value="..\source\uCEFv8Handler.pas"/>
@ -511,107 +511,111 @@
<UnitName Value="uCEFZipReader"/>
</Item121>
<Item122>
<Filename Value="..\source\uCEFChromiumCore.pas"/>
<UnitName Value="uCEFChromiumCore"/>
</Item122>
<Item123>
<Filename Value="..\source\uCEFChromium.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="uCEFChromium"/>
</Item122>
<Item123>
</Item123>
<Item124>
<Filename Value="..\source\uCEFBufferPanel.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="uCEFBufferPanel"/>
</Item123>
<Item124>
<Filename Value="..\source\uCEFServer.pas"/>
<UnitName Value="uCEFServer"/>
</Item124>
<Item125>
<Filename Value="..\source\uCEFServer.pas"/>
<UnitName Value="uCEFServer"/>
</Item125>
<Item126>
<Filename Value="..\source\uCEFServerComponent.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="uCEFServerComponent"/>
</Item125>
<Item126>
<Filename Value="..\source\uCEFServerEvents.pas"/>
<UnitName Value="uCEFServerEvents"/>
</Item126>
<Item127>
<Filename Value="..\source\uCEFServerHandler.pas"/>
<UnitName Value="uCEFServerHandler"/>
<Filename Value="..\source\uCEFServerEvents.pas"/>
<UnitName Value="uCEFServerEvents"/>
</Item127>
<Item128>
<Filename Value="..\source\res\tbufferpanel.lrs"/>
<Type Value="LRS"/>
<Filename Value="..\source\uCEFServerHandler.pas"/>
<UnitName Value="uCEFServerHandler"/>
</Item128>
<Item129>
<Filename Value="..\source\res\tcefservercomponent.lrs"/>
<Filename Value="..\source\res\tbufferpanel.lrs"/>
<Type Value="LRS"/>
</Item129>
<Item130>
<Filename Value="..\source\res\tcefwindowparent.lrs"/>
<Filename Value="..\source\res\tcefservercomponent.lrs"/>
<Type Value="LRS"/>
</Item130>
<Item131>
<Filename Value="..\source\res\tcefworkscheduler.lrs"/>
<Filename Value="..\source\res\tcefwindowparent.lrs"/>
<Type Value="LRS"/>
</Item131>
<Item132>
<Filename Value="..\source\res\tchromium.lrs"/>
<Filename Value="..\source\res\tcefworkscheduler.lrs"/>
<Type Value="LRS"/>
</Item132>
<Item133>
<Filename Value="..\source\res\tchromiumwindow.lrs"/>
<Filename Value="..\source\res\tchromium.lrs"/>
<Type Value="LRS"/>
</Item133>
<Item134>
<Filename Value="..\source\uCEFWinControl.pas"/>
<UnitName Value="uCEFWinControl"/>
<Filename Value="..\source\res\tchromiumwindow.lrs"/>
<Type Value="LRS"/>
</Item134>
<Item135>
<Filename Value="..\source\uCEFWinControl.pas"/>
<UnitName Value="uCEFWinControl"/>
</Item135>
<Item136>
<Filename Value="..\source\uCEFLinkedWindowParent.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="uCEFLinkedWindowParent"/>
</Item135>
<Item136>
<Filename Value="..\source\uCEFUrlRequestClientEvents.pas"/>
<UnitName Value="uCEFUrlRequestClientEvents"/>
</Item136>
<Item137>
<Filename Value="..\source\uCEFUrlRequestClientEvents.pas"/>
<UnitName Value="uCEFUrlRequestClientEvents"/>
</Item137>
<Item138>
<Filename Value="..\source\uCEFUrlRequestClientComponent.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="uCEFUrlRequestClientComponent"/>
</Item137>
<Item138>
<Filename Value="..\source\uCEFOSRIMEHandler.pas"/>
<UnitName Value="uCEFOSRIMEHandler"/>
</Item138>
<Item139>
<Filename Value="..\source\uCEFCookieAccessFilter.pas"/>
<UnitName Value="uCEFCookieAccessFilter"/>
<Filename Value="..\source\uCEFOSRIMEHandler.pas"/>
<UnitName Value="uCEFOSRIMEHandler"/>
</Item139>
<Item140>
<Filename Value="..\source\uCEFResourceReadCallback.pas"/>
<UnitName Value="uCEFResourceReadCallback"/>
<Filename Value="..\source\uCEFCookieAccessFilter.pas"/>
<UnitName Value="uCEFCookieAccessFilter"/>
</Item140>
<Item141>
<Filename Value="..\source\uCEFResourceRequestHandler.pas"/>
<UnitName Value="uCEFResourceRequestHandler"/>
<Filename Value="..\source\uCEFResourceReadCallback.pas"/>
<UnitName Value="uCEFResourceReadCallback"/>
</Item141>
<Item142>
<Filename Value="..\source\uCEFResourceSkipCallback.pas"/>
<UnitName Value="uCEFResourceSkipCallback"/>
<Filename Value="..\source\uCEFResourceRequestHandler.pas"/>
<UnitName Value="uCEFResourceRequestHandler"/>
</Item142>
<Item143>
<Filename Value="..\source\res\tcefsentinel.lrs"/>
<Type Value="LRS"/>
<Filename Value="..\source\uCEFResourceSkipCallback.pas"/>
<UnitName Value="uCEFResourceSkipCallback"/>
</Item143>
<Item144>
<Filename Value="..\source\res\tcefsentinel.lrs"/>
<Type Value="LRS"/>
</Item144>
<Item145>
<Filename Value="..\source\uCEFSentinel.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="uCEFSentinel"/>
</Item144>
<Item145>
</Item145>
<Item146>
<Filename Value="..\source\uCEFApplicationCore.pas"/>
<UnitName Value="uCEFApplicationCore"/>
</Item145>
</Item146>
</Files>
<RequiredPkgs Count="3">
<Item1>

View File

@ -39,17 +39,18 @@ uses
uCEFStringMap, uCEFStringMultimap, uCEFStringVisitor, uCEFTask,
uCEFTaskRunner, uCEFThread, uCEFTypes, uCEFUrlRequest, uCEFUrlrequestClient,
uCEFv8Accessor, uCEFv8ArrayBufferReleaseCallback, uCEFv8Context,
uCEFV8Exception, uCEFv8Handler, uCEFv8Interceptor, uCEFv8StackFrame,
uCEFv8Exception, uCEFv8Handler, uCEFv8Interceptor, uCEFv8StackFrame,
uCEFv8StackTrace, uCEFv8Value, uCEFValue, uCEFWaitableEvent,
uCEFWebPluginInfo, uCEFWebPluginInfoVisitor, uCEFWebPluginUnstableCallback,
uCEFWindowParent, uCEFWorkScheduler, uCEFWorkSchedulerThread,
uCEFWriteHandler, uCEFX509Certificate, uCEFX509CertPrincipal, uCEFXmlReader,
uCEFZipReader, uCEFChromium, uCEFBufferPanel, uCEFServer,
uCEFZipReader, uCEFChromiumCore, uCEFChromium, uCEFBufferPanel, uCEFServer,
uCEFServerComponent, uCEFServerEvents, uCEFServerHandler, uCEFWinControl,
uCEFLinkedWindowParent, uCEFUrlRequestClientEvents,
uCEFUrlRequestClientComponent, uCEFOSRIMEHandler, uCEFCookieAccessFilter,
uCEFResourceReadCallback, uCEFResourceRequestHandler,
uCEFResourceSkipCallback, uCEFSentinel, LazarusPackageIntf;
uCEFResourceSkipCallback, uCEFSentinel, uCEFApplicationCore,
LazarusPackageIntf;
implementation

View File

@ -884,12 +884,11 @@ function TCefApplicationCore.CheckCEFLibrary : boolean;
var
TempString, TempOldDir : string;
TempMissingFrm, TempMissingRsc, TempMissingLoc, TempMissingSubProc : boolean;
{$IFDEF MSWINDOWS}
TempMachine : integer;
TempVersionInfo : TFileVersionInfo;
{$ENDIF}
begin
{$IFNDEF MSWINDOWS}
Result := True;
{$ELSE}
Result := False;
if not(FCheckCEFFiles) or (FProcessType <> ptBrowser) then
@ -901,93 +900,99 @@ begin
TempOldDir := GetCurrentDir;
chdir(GetModulePath);
end;
try
TempMissingSubProc := not(CheckSubprocessPath(FBrowserSubprocessPath, FMissingLibFiles));
TempMissingFrm := not(CheckDLLs(FFrameworkDirPath, FMissingLibFiles));
TempMissingRsc := not(CheckResources(FResourcesDirPath, FMissingLibFiles, FCheckDevToolsResources, not(FDisableExtensions)));
TempMissingLoc := not(CheckLocales(FLocalesDirPath, FMissingLibFiles, FLocalesRequired));
TempMissingSubProc := not(CheckSubprocessPath(FBrowserSubprocessPath, FMissingLibFiles));
TempMissingFrm := not(CheckDLLs(FFrameworkDirPath, FMissingLibFiles));
TempMissingRsc := not(CheckResources(FResourcesDirPath, FMissingLibFiles, FCheckDevToolsResources, not(FDisableExtensions)));
TempMissingLoc := not(CheckLocales(FLocalesDirPath, FMissingLibFiles, FLocalesRequired));
if TempMissingFrm or TempMissingRsc or TempMissingLoc or TempMissingSubProc then
begin
FStatus := asErrorMissingFiles;
TempString := 'CEF binaries missing !';
if (length(FMissingLibFiles) > 0) then
TempString := TempString + CRLF + CRLF +
'The missing files are :' + CRLF +
trim(FMissingLibFiles);
ShowErrorMessageDlg(TempString);
end
else
if CheckDLLVersion(LibCefPath,
CEF_SUPPORTED_VERSION_MAJOR,
CEF_SUPPORTED_VERSION_MINOR,
CEF_SUPPORTED_VERSION_RELEASE,
CEF_SUPPORTED_VERSION_BUILD) then
if TempMissingFrm or TempMissingRsc or TempMissingLoc or TempMissingSubProc then
begin
if GetDLLHeaderMachine(LibCefPath, TempMachine) then
case TempMachine of
CEF_IMAGE_FILE_MACHINE_I386 :
if Is32BitProcess then
Result := True
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Wrong CEF binaries !' +
CRLF + CRLF +
'Use the 32 bit CEF binaries with 32 bits applications only.';
FStatus := asErrorMissingFiles;
TempString := 'CEF binaries missing !';
ShowErrorMessageDlg(TempString);
end;
CEF_IMAGE_FILE_MACHINE_AMD64 :
if not(Is32BitProcess) then
Result := True
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Wrong CEF binaries !' +
CRLF + CRLF +
'Use the 64 bit CEF binaries with 64 bits applications only.';
ShowErrorMessageDlg(TempString);
end;
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Unknown CEF binaries !' +
CRLF + CRLF +
'Use only the CEF binaries specified in the CEF4Delphi Readme.md file at ' +
CEF4DELPHI_URL;
ShowErrorMessageDlg(TempString);
end;
end
else
Result := True;
end
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Unsupported CEF version !' +
CRLF + CRLF +
'Use only the CEF binaries specified in the CEF4Delphi Readme.md file at ' +
CEF4DELPHI_URL;
if GetDLLVersion(LibCefPath, TempVersionInfo) then
if (length(FMissingLibFiles) > 0) then
TempString := TempString + CRLF + CRLF +
'Expected ' + LIBCEF_DLL + ' version : ' + LibCefVersion + CRLF +
'Found ' + LIBCEF_DLL + ' version : ' + FileVersionInfoToString(TempVersionInfo);
'The missing files are :' + CRLF +
trim(FMissingLibFiles);
ShowErrorMessageDlg(TempString);
end;
end
else
{$IFDEF MSWINDOWS}
if CheckDLLVersion(LibCefPath,
CEF_SUPPORTED_VERSION_MAJOR,
CEF_SUPPORTED_VERSION_MINOR,
CEF_SUPPORTED_VERSION_RELEASE,
CEF_SUPPORTED_VERSION_BUILD) then
begin
if GetDLLHeaderMachine(LibCefPath, TempMachine) then
case TempMachine of
CEF_IMAGE_FILE_MACHINE_I386 :
if Is32BitProcess then
Result := True
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Wrong CEF binaries !' +
CRLF + CRLF +
'Use the 32 bit CEF binaries with 32 bits applications only.';
if FSetCurrentDir then chdir(TempOldDir);
ShowErrorMessageDlg(TempString);
end;
CEF_IMAGE_FILE_MACHINE_AMD64 :
if not(Is32BitProcess) then
Result := True
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Wrong CEF binaries !' +
CRLF + CRLF +
'Use the 64 bit CEF binaries with 64 bits applications only.';
ShowErrorMessageDlg(TempString);
end;
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Unknown CEF binaries !' +
CRLF + CRLF +
'Use only the CEF binaries specified in the CEF4Delphi Readme.md file at ' +
CEF4DELPHI_URL;
ShowErrorMessageDlg(TempString);
end;
end
else
Result := True;
end
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Unsupported CEF version !' +
CRLF + CRLF +
'Use only the CEF binaries specified in the CEF4Delphi Readme.md file at ' +
CEF4DELPHI_URL;
if GetDLLVersion(LibCefPath, TempVersionInfo) then
TempString := TempString + CRLF + CRLF +
'Expected ' + LIBCEF_DLL + ' version : ' + LibCefVersion + CRLF +
'Found ' + LIBCEF_DLL + ' version : ' + FileVersionInfoToString(TempVersionInfo);
ShowErrorMessageDlg(TempString);
end;
{$ELSE}
begin
Result := True;
end;
{$ENDIF}
finally
if FSetCurrentDir then chdir(TempOldDir);
end;
end;
{$ENDIF}
end;
function TCefApplicationCore.StartMainProcess : boolean;
@ -1269,7 +1274,11 @@ begin
{$IFDEF DELPHI14_UP}
TempThread.Start;
{$ELSE}
{$IFNDEF FPC}
TempThread.Resume;
{$ELSE}
TempThread.Start;
{$ENDIF}
{$ENDIF}
end
else
@ -1527,8 +1536,10 @@ procedure TCefApplicationCore.Internal_OnBeforeCommandLineProcessing(const proce
const commandLine : ICefCommandLine);
var
i : integer;
{$IFDEF MSWINDOWS}
TempVersionInfo : TFileVersionInfo;
TempFileName : string;
{$ENDIF}
begin
if (commandLine <> nil) and (FProcessType = ptBrowser) and (processType = '') then
begin
@ -1867,11 +1878,7 @@ begin
ZeroMemory(@TempMemCtrs, SizeOf(TProcessMemoryCounters));
TempMemCtrs.cb := SizeOf(TProcessMemoryCounters);
{$IFDEF FPC}
if GetProcessMemoryInfo(TempProcHWND, TempMemCtrs, TempMemCtrs.cb) then inc(Result, TempMemCtrs.WorkingSetSize);
{$ELSE}
if GetProcessMemoryInfo(TempProcHWND, @TempMemCtrs, TempMemCtrs.cb) then inc(Result, TempMemCtrs.WorkingSetSize);
{$ENDIF}
if GetProcessMemoryInfo(TempProcHWND, {$IFNDEF FPC}@{$ENDIF}TempMemCtrs, TempMemCtrs.cb) then inc(Result, TempMemCtrs.WorkingSetSize);
CloseHandle(TempProcHWND);
end;

File diff suppressed because it is too large Load Diff

4971
source/uCEFChromiumCore.pas Normal file

File diff suppressed because it is too large Load Diff

View File

@ -116,6 +116,14 @@ implementation
uses
uCEFMiscFunctions, uCEFWriteHandler, uCEFStreamWriter, uCEFConstants;
{$IFDEF FPC}
const
//CFSTR_FILEDESCRIPTORA = 'FileGroupDescriptor'; // CF_FILEGROUPDESCRIPTORA
CFSTR_FILEDESCRIPTORW = 'FileGroupDescriptorW'; // CF_FILEGROUPDESCRIPTORW
CFSTR_FILEDESCRIPTOR = CFSTR_FILEDESCRIPTORW;
CFSTR_FILECONTENTS = 'FileContents'; // CF_FILECONTENTS
{$ENDIF}
// *****************************************************
// **************** TCEFDragAndDropMgr *****************
// *****************************************************
@ -667,7 +675,11 @@ begin
while (TempEnumFrmt.Next(1, TempFormat, nil) = S_OK) and not(TempUsed) do
begin
try
{$IFNDEF FPC}
TempMedium.unkForRelease := nil;
{$ELSE}
TempMedium.PUnkForRelease := nil;
{$ENDIF}
if ((TempFormat.tymed and TYMED_HGLOBAL) <> 0) and
(aDataObject.GetData(TempFormat, TempMedium) = S_OK) then
@ -722,7 +734,11 @@ begin
TempResEffect := DROPEFFECT_NONE;
TempDataObject := TOLEDataObject.Create(TempFormatArray, TempMediumArray, i);
TempDropSource := TOLEDropSource.Create;
{$IFNDEF FPC}
TempResult := DoDragDrop(TempDataObject, TempDropSource, FOLEEffect, TempResEffect);
{$ELSE}
TempResult := DoDragDrop(TempDataObject, TempDropSource, DWORD(FOLEEffect), LPDWORD(TempResEffect));
{$ENDIF}
if (TempResult <> DRAGDROP_S_DROP) then TempResEffect := DROPEFFECT_NONE;
FCurrentDragData := nil;

View File

@ -70,7 +70,7 @@ type
implementation
uses
uCEFMiscFunctions, uCEFLibFunctions, uCEFDictionaryValue, uCEFRequestContext, uCefExtensionHandler;
uCEFMiscFunctions, uCEFLibFunctions, uCEFDictionaryValue, uCEFRequestContext, uCEFExtensionHandler;
function TCefExtensionRef.GetIdentifier : ustring;
begin

File diff suppressed because it is too large Load Diff

View File

@ -53,7 +53,7 @@ uses
{$IFDEF MSWINDOWS}WinApi.Windows, WinApi.ActiveX,{$ENDIF} System.IOUtils, System.Classes, System.SysUtils, System.UITypes, System.Math,
{$ELSE}
{$IFDEF MSWINDOWS}Windows, ActiveX,{$ENDIF} {$IFDEF DELPHI14_UP}IOUtils,{$ENDIF} Classes, SysUtils, Math,
{$IFDEF FPC}LCLType,{$IFNDEF MSWINDOWS}InterfaceBase,{$ENDIF}{$ENDIF}
{$IFDEF FPC}LCLType,{$IFNDEF MSWINDOWS}InterfaceBase, Forms,{$ENDIF}{$ENDIF}
{$ENDIF}
uCEFTypes, uCEFInterfaces, uCEFLibFunctions, uCEFResourceHandler,
uCEFRegisterCDMCallback, uCEFConstants;
@ -104,9 +104,9 @@ function cef_string_utf16_copy(const src: PChar16; src_len: NativeUInt; output:
function cef_string_copy(const src: PCefChar; src_len: NativeUInt; output: PCefString): Integer;
{$IFDEF MSWINDOWS}
procedure WindowInfoAsChild(var aWindowInfo : TCefWindowInfo; aParent : THandle; aRect : TRect; const aWindowName : ustring = ''; aExStyle : cardinal = 0);
procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : THandle; const aWindowName : ustring = ''; aExStyle : cardinal = 0);
procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : THandle; const aWindowName : ustring = ''; aExStyle : cardinal = 0);
procedure WindowInfoAsChild(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; aRect : TRect; const aWindowName : ustring = ''; aExStyle : cardinal = 0);
procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring = ''; aExStyle : cardinal = 0);
procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring = ''; aExStyle : cardinal = 0);
{$ENDIF}
{$IFDEF MACOS}
@ -136,6 +136,8 @@ function PathIsURLAnsi(pszPath: LPCSTR): BOOL; stdcall; external SHLWAPIDLL name
function PathIsURLUnicode(pszPath: LPCWSTR): BOOL; stdcall; external SHLWAPIDLL name 'PathIsURLW';
{$IFNDEF DELPHI12_UP}
const
GWLP_WNDPROC = GWL_WNDPROC;
{$IFDEF WIN64}
function SetWindowLongPtr(hWnd: HWND; nIndex: Integer; dwNewLong: int64): int64; stdcall; external user32 name 'SetWindowLongPtrW';
{$ELSE}
@ -561,7 +563,7 @@ begin
end;
{$IFDEF MSWINDOWS}
procedure WindowInfoAsChild(var aWindowInfo : TCefWindowInfo; aParent : THandle; aRect : TRect; const aWindowName : ustring; aExStyle : cardinal);
procedure WindowInfoAsChild(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; aRect : TRect; const aWindowName : ustring; aExStyle : cardinal);
begin
aWindowInfo.ex_style := aExStyle;
aWindowInfo.window_name := CefString(aWindowName);
@ -578,7 +580,7 @@ begin
aWindowInfo.window := 0;
end;
procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : THandle; const aWindowName : ustring; aExStyle : cardinal);
procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring; aExStyle : cardinal);
begin
aWindowInfo.ex_style := aExStyle;
aWindowInfo.window_name := CefString(aWindowName);
@ -595,7 +597,7 @@ begin
aWindowInfo.window := 0;
end;
procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : THandle; const aWindowName : ustring; aExStyle : cardinal);
procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; const aWindowName : ustring; aExStyle : cardinal);
begin
aWindowInfo.ex_style := aExStyle;
aWindowInfo.window_name := CefString(aWindowName);
@ -629,7 +631,7 @@ begin
aWindowInfo.view := 0;
end;
procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : THandle; aHidden : boolean; const aWindowName : ustring);
procedure WindowInfoAsPopUp(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; aHidden : boolean; const aWindowName : ustring);
begin
aWindowInfo.window_name := CefString(aWindowName);
aWindowInfo.x := integer(CW_USEDEFAULT);
@ -644,7 +646,7 @@ begin
aWindowInfo.view := 0;
end;
procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : THandle; aHidden : boolean; const aWindowName : ustring);
procedure WindowInfoAsWindowless(var aWindowInfo : TCefWindowInfo; aParent : TCefWindowHandle; aHidden : boolean; const aWindowName : ustring);
begin
aWindowInfo.window_name := CefString(aWindowName);
@ -879,9 +881,10 @@ function SplitLongString(aSrcString : string) : string;
const
MAXLINELENGTH = 50;
begin
Result := '';
while (length(aSrcString) > 0) do
begin
if (length(Result) > 0) then
if (Result <> '') then
Result := Result + CRLF + copy(aSrcString, 1, MAXLINELENGTH)
else
Result := Result + copy(aSrcString, 1, MAXLINELENGTH);
@ -972,7 +975,7 @@ begin
if (length(aLocalesDirPath) > 0) then
TempDir := IncludeTrailingPathDelimiter(aLocalesDirPath)
else
TempDir := 'locales\';
TempDir := 'locales' + PathDelim;
TempList := TStringList.Create;
@ -1071,11 +1074,19 @@ begin
TempList := TStringList.Create;
TempList.Add(TempDir + CHROMEELF_DLL);
TempList.Add(TempDir + LIBCEF_DLL);
{$IFDEF MSWINDOWS}
TempList.Add(TempDir + 'd3dcompiler_47.dll');
TempList.Add(TempDir + 'libEGL.dll');
TempList.Add(TempDir + 'libGLESv2.dll');
TempList.Add(TempDir + 'swiftshader\libEGL.dll');
TempList.Add(TempDir + 'swiftshader\libGLESv2.dll');
{$ENDIF}
{$IFDEF LINUX}
TempList.Add(TempDir + 'libEGL.so');
TempList.Add(TempDir + 'libGLESv2.so');
TempList.Add(TempDir + 'swiftshader/libEGL.so');
TempList.Add(TempDir + 'swiftshader/libGLESv2.so');
{$ENDIF}
TempList.Add(TempDir + 'icudtl.dat');
if TempExists then
@ -1491,7 +1502,7 @@ begin
end;
function CustomAbsolutePath(const aPath : string; aMustExist : boolean) : string;
var
var
TempNewPath, TempOldPath : string;
begin
if (length(aPath) > 0) then
@ -1505,8 +1516,8 @@ begin
TempNewPath := TempOldPath;
if aMustExist and not(DirectoryExists(TempNewPath)) then
Result := ''
else
Result := ''
else
Result := TempNewPath;
end
else
@ -1515,7 +1526,12 @@ end;
function GetModulePath : string;
begin
{$IFDEF MSWINDOWS}
Result := IncludeTrailingPathDelimiter(ExtractFileDir(GetModuleName(HINSTANCE{$IFDEF FPC}(){$ENDIF})));
{$ELSE}
// DLL filename not supported
Result := IncludeTrailingPathDelimiter(ExtractFileDir(ParamStr(0)));
{$ENDIF MSWINDOWS}
end;
function CefParseUrl(const url: ustring; var parts: TUrlParts): Boolean;
@ -2080,8 +2096,8 @@ begin
try
if (aFileList <> nil) and
(length(aSrcDirectory) > 0) and
(length(aDstDirectory) > 0) and
DirectoryExists(aSrcDirectory) and
(length(aDstDirectory) > 0) and
DirectoryExists(aSrcDirectory) and
(DirectoryExists(aDstDirectory) or CreateDir(aDstDirectory)) then
begin
i := 0;
@ -2089,9 +2105,9 @@ begin
while (i < aFileList.Count) do
begin
TempSrcPath := IncludeTrailingPathDelimiter(aSrcDirectory) + aFileList[i];
TempDstPath := IncludeTrailingPathDelimiter(aDstDirectory) + aFileList[i];
TempSrcPath := IncludeTrailingPathDelimiter(aSrcDirectory) + aFileList[i];
TempDstPath := IncludeTrailingPathDelimiter(aDstDirectory) + aFileList[i];
if FileExists(TempSrcPath) and RenameFile(TempSrcPath, TempDstPath) then inc(TempCount);
inc(i);

View File

@ -72,7 +72,7 @@ type
implementation
uses
uCEFMiscFunctions, uCefSSLStatus;
uCEFMiscFunctions, uCEFSSLStatus;
function TCefNavigationEntryRef.IsValid: Boolean;
begin

View File

@ -88,8 +88,13 @@ type
destructor Destroy; override;
// IEnumFormatEtc
function Next(Celt: LongInt; out Elt; pCeltFetched: pLongInt): HRESULT; stdcall;
{$IFNDEF FPC}
function Next(Celt: LongInt; out Rgelt; pCeltFetched: pLongInt): HRESULT; stdcall;
function Skip(Celt: Longint): HRESULT; stdcall;
{$ELSE}
function Next(Celt: ULONG; out Rgelt: FormatEtc; pceltFetched: PULONG = nil): HRESULT; stdcall;
function Skip(Celt: ULONG): HRESULT; stdcall;
{$ENDIF}
function Reset: HRESULT; stdcall;
function Clone(out Enum: IEnumFormatEtc): HRESULT; stdcall;
end;
@ -97,8 +102,13 @@ type
TOLEDropSource = class(TInterfacedObject, IDropSource)
public
// IDropSource
{$IFNDEF FPC}
function QueryContinueDrag(fEscapePressed: bool; grfKeyState: LongInt): HRESULT; stdcall;
function GiveFeedback(dwEffect: LongInt): HRESULT; stdcall;
{$ELSE}
function QueryContinueDrag(fEscapePressed: BOOL; grfKeyState: DWORD): HRESULT; stdcall;
function GiveFeedback(dwEffect: DWORD): HRESULT; stdcall;
{$ENDIF}
end;
TOLEDataObject = class(TInterfacedObject, IDataObject)
@ -120,11 +130,19 @@ type
function GetDataHere(const FormatEtc: TFormatEtc; out Medium: TStgMedium):HRESULT; stdcall;
function QueryGetData(const FormatEtc: TFormatEtc): HRESULT; stdcall;
function GetCanonicalFormatEtc(const FormatEtc: TFormatEtc; out FormatEtcout: TFormatEtc): HRESULT; stdcall;
{$IFNDEF FPC}
function SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; fRelease: Bool): HRESULT; stdcall;
function EnumFormatEtc(dwDirection: LongInt; out aEnumFormatEtc: IEnumFormatEtc): HRESULT; stdcall;
function dAdvise(const FormatEtc: TFormatEtc; advf: LongInt; const advsink: IAdviseSink; out dwConnection: LongInt): HRESULT; stdcall;
function dUnadvise(dwConnection: LongInt): HRESULT; stdcall;
{$ELSE}
function SetData(const pformatetc: FORMATETC; const medium: STGMEDIUM; FRelease: BOOL): HRESULT; stdcall;
function EnumFormatEtc(dwDirection: DWORD; out aEnumFormatEtc: IENUMFORMATETC): HRESULT; stdcall;
function DAdvise(const formatetc: FORMATETC; advf: DWORD; const AdvSink: IAdviseSink; out dwConnection: DWORD): HRESULT; stdcall;
function DUnadvise(dwconnection: DWORD): HRESULT; stdcall;
{$ENDIF}
function EnumdAdvise(out EnumAdvise: IEnumStatData): HRESULT; stdcall;
end;
TOLEDropTarget = class(TInterfacedObject, IDropTarget)
@ -135,10 +153,17 @@ type
constructor Create(const aManager : TOLEDragAndDropMgr); reintroduce;
// IDropTarget
{$IFNDEF FPC}
function DragEnter(const DataObj: IDataObject; grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HRESULT; stdcall;
function DragOver(grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HRESULT; stdcall;
function DragLeave: HRESULT; stdcall;
function Drop(const dataObj: IDataObject; grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HRESULT; stdcall;
{$ELSE}
function DragEnter(const dataObj: IDataObject; grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HRESULT; stdcall;
function DragOver(grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HRESULT; stdcall;
function Drop(const dataObj: IDataObject; grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HRESULT; stdcall;
{$ENDIF}
function DragLeave: HRESULT; stdcall;
end;
implementation
@ -168,7 +193,11 @@ begin
aMedium.hGlobal := TempHandle;
aMedium.tymed := TYMED_HGLOBAL;
{$IFNDEF FPC}
aMedium.unkForRelease := nil;
{$ELSE}
aMedium.PUnkForRelease := nil;
{$ENDIF}
GlobalUnlock(TempHandle);
@ -207,6 +236,10 @@ begin
end;
function TOLEDragAndDropMgr.GetStorageForFileDescriptor(var aMedium : TStgMedium; const aFileName : string) : boolean;
{$IFDEF FPC}
const
FD_LINKUI = $8000;
{$ENDIF}
var
TempHandle : HGLOBAL;
TempDescriptor : TFileGroupDescriptor;
@ -243,7 +276,11 @@ begin
aMedium.tymed := TYMED_HGLOBAL;
aMedium.hGlobal := TempHandle;
{$IFNDEF FPC}
aMedium.unkForRelease := nil;
{$ELSE}
aMedium.PUnkForRelease := nil;
{$ENDIF}
GlobalUnlock(TempHandle);
@ -330,6 +367,8 @@ begin
end;
procedure TOLEEnumFormatEtc.CopyFormatEtc(var aDstFormatEtc : TFormatEtc; const aSrcFormatEtc : TFormatEtc);
var
Size: Integer;
begin
aDstFormatEtc.cfFormat := aSrcFormatEtc.cfFormat;
aDstFormatEtc.dwAspect := aSrcFormatEtc.dwAspect;
@ -340,27 +379,28 @@ begin
aDstFormatEtc.ptd := nil
else
begin
aDstFormatEtc.ptd := CoTaskMemAlloc(SizeOf(TDVTargetDevice));
aDstFormatEtc.ptd.tdSize := aSrcFormatEtc.ptd.tdSize;
aDstFormatEtc.ptd.tdDriverNameOffset := aSrcFormatEtc.ptd.tdDriverNameOffset;
aDstFormatEtc.ptd.tdDeviceNameOffset := aSrcFormatEtc.ptd.tdDeviceNameOffset;
aDstFormatEtc.ptd.tdPortNameOffset := aSrcFormatEtc.ptd.tdPortNameOffset;
aDstFormatEtc.ptd.tdExtDevmodeOffset := aSrcFormatEtc.ptd.tdExtDevmodeOffset;
aDstFormatEtc.ptd.tdData := aSrcFormatEtc.ptd.tdData;
Size := Max(aSrcFormatEtc.ptd^.tdSize, SizeOf(DVTARGETDEVICE));
aDstFormatEtc.ptd := CoTaskMemAlloc(Size);
Move(aSrcFormatEtc.ptd^, aDstFormatEtc.ptd^, Size);
end;
end;
function TOLEEnumFormatEtc.Next(Celt: LongInt; out Elt; pCeltFetched: pLongInt): HRESULT;
function TOLEEnumFormatEtc.Next
{$IFNDEF FPC}
(Celt: LongInt; out Rgelt; pCeltFetched: pLongInt): HRESULT; stdcall;
{$ELSE}
(Celt: ULONG; out Rgelt: FormatEtc; pceltFetched: PULONG): HRESULT; stdcall;
{$ENDIF}
var
i : integer;
TempArray : TOLEFormatArray absolute Elt;
TempArray : ^TOLEFormatArray;
begin
i := 0;
TempArray := @Rgelt;
while (i < Celt) and (FIndex < FNumFormats) do
begin
CopyFormatEtc(TempArray[i], FFormatArray[FIndex]);
CopyFormatEtc(TempArray^[i], FFormatArray[FIndex]);
inc(i);
inc(FIndex);
end;
@ -373,7 +413,12 @@ begin
Result := S_FALSE;
end;
function TOLEEnumFormatEtc.Skip(Celt: Longint): HRESULT;
function TOLEEnumFormatEtc.Skip
{$IFNDEF FPC}
(Celt: Longint): HRESULT; stdcall;
{$ELSE}
(Celt: ULONG): HRESULT; stdcall;
{$ENDIF}
begin
FIndex := FIndex + Celt;
@ -383,13 +428,13 @@ begin
Result := S_FALSE;
end;
function TOLEEnumFormatEtc.Reset: HRESULT;
function TOLEEnumFormatEtc.Reset: HRESULT; stdcall;
begin
FIndex := 0;
Result := S_OK;
end;
function TOLEEnumFormatEtc.Clone(out Enum: IEnumFormatEtc): HRESULT;
function TOLEEnumFormatEtc.Clone(out Enum: IEnumFormatEtc): HRESULT; stdcall;
begin
Enum := TOLEEnumFormatEtc.Create(FFormatArray, FNumFormats, FIndex);
Result := S_OK;
@ -407,14 +452,24 @@ begin
FManager := aManager;
end;
function TOLEDropTarget.DragEnter(const DataObj: IDataObject; grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HRESULT; stdcall;
function TOLEDropTarget.DragEnter
{$IFNDEF FPC}
(const DataObj: IDataObject; grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HRESULT; stdcall;
{$ELSE}
(const dataObj: IDataObject; grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HRESULT; stdcall;
{$ENDIF}
begin
Result := FManager.DragEnter(DataObj, grfKeyState, pt, dwEffect);
Result := FManager.DragEnter(DataObj, grfKeyState, pt, Longint(dwEffect));
end;
function TOLEDropTarget.DragOver(grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HRESULT; stdcall;
function TOLEDropTarget.DragOver
{$IFNDEF FPC}
(grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HRESULT; stdcall;
{$ELSE}
(grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HRESULT; stdcall;
{$ENDIF}
begin
Result := FManager.DragOver(grfKeyState, pt, dwEffect);
Result := FManager.DragOver(grfKeyState, pt, Longint(dwEffect));
end;
function TOLEDropTarget.DragLeave: HRESULT; stdcall;
@ -422,9 +477,14 @@ begin
Result := FManager.DragLeave;
end;
function TOLEDropTarget.Drop(const dataObj: IDataObject; grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HRESULT; stdcall;
function TOLEDropTarget.Drop
{$IFNDEF FPC}
(const dataObj: IDataObject; grfKeyState: Longint; pt: TPoint; var dwEffect: Longint): HRESULT; stdcall;
{$ELSE}
(const dataObj: IDataObject; grfKeyState: DWORD; pt: TPoint; var dwEffect: DWORD): HRESULT; stdcall;
{$ENDIF}
begin
Result := FManager.Drop(dataObj, grfKeyState, pt, dwEffect);
Result := FManager.Drop(dataObj, grfKeyState, pt, Longint(dwEffect));
end;
@ -432,7 +492,12 @@ end;
// ****************** TOLEDropSource *******************
// *****************************************************
function TOLEDropSource.QueryContinueDrag(fEscapePressed: bool; grfKeyState: LongInt): HRESULT; stdcall;
function TOLEDropSource.QueryContinueDrag
{$IFNDEF FPC}
(fEscapePressed: bool; grfKeyState: LongInt): HRESULT; stdcall;
{$ELSE}
(fEscapePressed: BOOL; grfKeyState: DWORD): HRESULT; stdcall;
{$ENDIF}
begin
if fEscapePressed then
Result := DRAGDROP_S_CANCEL
@ -443,7 +508,12 @@ begin
Result := S_OK;
end;
function TOLEDropSource.GiveFeedback(dwEffect: LongInt): HRESULT; stdcall;
function TOLEDropSource.GiveFeedback
{$IFNDEF FPC}
(dwEffect: LongInt): HRESULT; stdcall;
{$ELSE}
(dwEffect: DWORD): HRESULT; stdcall;
{$ENDIF}
begin
Result := DRAGDROP_S_USEDEFAULTCURSORS;
end;
@ -542,14 +612,22 @@ begin
if (i < 0) or ((FFormatArray[i].tymed and TYMED_HGLOBAL) = 0) then
begin
Medium.tymed := TYMED_NULL;
{$IFNDEF FPC}
Medium.unkForRelease := nil;
{$ELSE}
Medium.PUnkForRelease := nil;
{$ENDIF}
Medium.hGlobal := 0;
Result := DV_E_FORMATETC;
end
else
begin
Medium.tymed := FFormatArray[i].tymed;
{$IFNDEF FPC}
Medium.unkForRelease := nil;
{$ELSE}
Medium.PUnkForRelease := nil;
{$ENDIF}
Medium.hGlobal := DupGlobalMem(FMediumArray[i].hGlobal);
Result := S_OK;
end;
@ -579,12 +657,22 @@ begin
Result := E_NOTIMPL;
end;
function TOLEDataObject.SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; fRelease: Bool): HRESULT; stdcall;
function TOLEDataObject.SetData
{$IFNDEF FPC}
(const FormatEtc: TFormatEtc; var Medium: TStgMedium; fRelease: Bool): HRESULT; stdcall;
{$ELSE}
(const pformatetc: FORMATETC; const medium: STGMEDIUM; FRelease: BOOL): HRESULT; stdcall;
{$ENDIF}
begin
Result := E_NOTIMPL;
end;
function TOLEDataObject.EnumFormatEtc(dwDirection: LongInt; out aEnumFormatEtc: IEnumFormatEtc): HRESULT; stdcall;
function TOLEDataObject.EnumFormatEtc
{$IFNDEF FPC}
(dwDirection: LongInt; out aEnumFormatEtc: IEnumFormatEtc): HRESULT; stdcall;
{$ELSE}
(dwDirection: DWORD; out aEnumFormatEtc: IENUMFORMATETC): HRESULT; stdcall;
{$ENDIF}
begin
if (dwDirection = DATADIR_GET) then
begin
@ -602,15 +690,22 @@ begin
end;
end;
function TOLEDataObject.dAdvise(const FormatEtc: TFormatEtc;
advf: LongInt;
const advsink: IAdviseSink;
out dwConnection: LongInt): HRESULT; stdcall;
function TOLEDataObject.dAdvise
{$IFNDEF FPC}
(const FormatEtc: TFormatEtc; advf: LongInt; const advsink: IAdviseSink; out dwConnection: LongInt): HRESULT; stdcall;
{$ELSE}
(const formatetc: FORMATETC; advf: DWORD; const AdvSink: IAdviseSink; out dwConnection: DWORD): HRESULT; stdcall;
{$ENDIF}
begin
Result := OLE_E_ADVISENOTSUPPORTED;
end;
function TOLEDataObject.dUnadvise(dwConnection: LongInt): HRESULT; stdcall;
function TOLEDataObject.dUnadvise
{$IFNDEF FPC}
(dwConnection: LongInt): HRESULT; stdcall;
{$ELSE}
(dwconnection: DWORD): HRESULT; stdcall;
{$ENDIF}
begin
Result := OLE_E_ADVISENOTSUPPORTED;
end;

View File

@ -80,7 +80,9 @@ type
{$IFNDEF FPC}{$IFDEF DELPHI16_UP}[ComponentPlatformsAttribute(pidWin32 or pidWin64)]{$ENDIF}{$ENDIF}
TCEFSentinel = class(TComponent)
protected
{$IFDEF MSWINDOWS}
FCompHandle : HWND;
{$ENDIF}
FStatus : TSentinelStatus;
FStatusCS : TCriticalSection;
FDelayPerProcMs : cardinal;
@ -99,8 +101,8 @@ type
procedure WndProc(var aMessage: TMessage);
procedure doStartMsg(var aMessage : TMessage); virtual;
procedure doCloseMsg(var aMessage : TMessage); virtual;
{$ENDIF}
function SendCompMessage(aMsg : cardinal) : boolean;
{$ENDIF}
function CanClose : boolean; virtual;
procedure Timer_OnTimer(Sender: TObject); virtual;
@ -137,7 +139,9 @@ constructor TCEFSentinel.Create(AOwner: TComponent);
begin
inherited Create(aOwner);
{$IFDEF MSWINDOWS}
FCompHandle := 0;
{$ENDIF}
FDelayPerProcMs := CEFSENTINEL_DEFAULT_DELAYPERPROCMS;
FMinInitDelayMs := CEFSENTINEL_DEFAULT_MININITDELAYMS;
FFinalDelayMs := CEFSENTINEL_DEFAULT_FINALDELAYMS;
@ -151,22 +155,13 @@ begin
end;
procedure TCEFSentinel.AfterConstruction;
{$IFDEF FPC}
var
TempWndMethod : TWndMethod;
{$ENDIF}
begin
inherited AfterConstruction;
if not(csDesigning in ComponentState) then
begin
{$IFDEF FPC}
{$IFDEF MSWINDOWS}
TempWndMethod := @WndProc;
FCompHandle := AllocateHWnd(TempWndMethod);
{$ENDIF}
{$ELSE}
FCompHandle := AllocateHWnd(WndProc);
FCompHandle := AllocateHWnd({$IFDEF FPC}@{$ENDIF}WndProc);
{$ENDIF}
FStatusCS := TCriticalSection.Create;
@ -218,12 +213,12 @@ procedure TCEFSentinel.doCloseMsg(var aMessage : TMessage);
begin
if assigned(FOnClose) then FOnClose(self);
end;
{$ENDIF}
function TCEFSentinel.SendCompMessage(aMsg : cardinal) : boolean;
begin
Result := (FCompHandle <> 0) and PostMessage(FCompHandle, aMsg, 0, 0);
end;
{$ENDIF}
procedure TCEFSentinel.Start;
begin
@ -233,7 +228,9 @@ begin
if (FStatus = ssIdle) then
begin
FStatus := ssInitialDelay;
{$IFDEF MSWINDOWS}
SendCompMessage(CEF_SENTINEL_START);
{$ENDIF}
end;
finally
if (FStatusCS <> nil) then FStatusCS.Release;
@ -280,7 +277,9 @@ begin
if CanClose then
begin
FStatus := ssClosing;
{$IFDEF MSWINDOWS}
SendCompMessage(CEF_SENTINEL_DOCLOSE);
{$ENDIF}
end
else
begin
@ -294,7 +293,9 @@ begin
if CanClose then
begin
FStatus := ssClosing;
{$IFDEF MSWINDOWS}
SendCompMessage(CEF_SENTINEL_DOCLOSE);
{$ENDIF}
end
else
begin

View File

@ -133,19 +133,21 @@ begin
end;
function TCEFWinControl.TakeSnapshot(var aBitmap : TBitmap) : boolean;
{$IFDEF MSWINDOWS}
var
TempHWND : HWND;
TempDC : HDC;
TempRect : TRect;
TempWidth : Integer;
TempHeight : Integer;
{$ENDIF}
begin
Result := False;
{$IFDEF MSWINDOWS}
if (aBitmap = nil) then exit;
TempHWND := ChildWindowHandle;
if (TempHWND = 0) then exit;
{$IFDEF MSWINDOWS}
{$IFDEF DELPHI16_UP}Winapi.{$ENDIF}Windows.GetClientRect(TempHWND, TempRect);
TempDC := GetDC(TempHWND);
TempWidth := TempRect.Right - TempRect.Left;
@ -163,12 +165,16 @@ begin
end;
function TCEFWinControl.DestroyChildWindow : boolean;
{$IFDEF MSWINDOWS}
var
TempHWND : HWND;
{$ENDIF}
begin
{$IFDEF MSWINDOWS}
TempHWND := ChildWindowHandle;
Result := (TempHWND <> 0) and DestroyWindow(TempHWND);
{$ELSE}
Result := False;
{$ENDIF}
end;

View File

@ -166,10 +166,6 @@ begin
end;
procedure TCEFWorkScheduler.AfterConstruction;
{$IFDEF FPC}
var
TempWndMethod : TWndMethod;
{$ENDIF}
begin
inherited AfterConstruction;
@ -179,12 +175,7 @@ begin
if (GlobalCEFApp <> nil) and
((GlobalCEFApp.ProcessType = ptBrowser) or GlobalCEFApp.SingleProcess) then
begin
{$IFDEF FPC}
TempWndMethod := @WndProc;
FCompHandle := AllocateHWnd(TempWndMethod);
{$ELSE}
FCompHandle := AllocateHWnd(WndProc);
{$ENDIF}
FCompHandle := AllocateHWnd({$IFDEF FPC}@{$ENDIF}WndProc);
end;
{$ENDIF}
@ -203,7 +194,11 @@ begin
{$IFDEF DELPHI14_UP}
FThread.Start;
{$ELSE}
{$IFNDEF FPC}
FThread.Resume;
{$ELSE}
FThread.Start;
{$ENDIF}
{$ENDIF}
end;

View File

@ -238,14 +238,7 @@ begin
{$IFDEF MSWINDOWS}
DeleteCriticalSection(FCriticalSection);
FCriticalSection.DebugInfo := nil;
FCriticalSection.LockCount := 0;
FCriticalSection.RecursionCount := 0;
FCriticalSection.OwningThread := 0;
FCriticalSection.LockSemaphore := 0;
{$IFNDEF FPC}
FCriticalSection.Reserved := 0;
{$ENDIF}
FillChar(FCriticalSection, SizeOf(FCriticalSection), 0);
{$ELSE}
DoneCriticalSection(FCriticalSection);
{$ENDIF}
@ -259,22 +252,24 @@ var
TempSize : int64;
begin
EnterCriticalSection(FCriticalSection);
try
TempSize := size * n;
TempSize := size * n;
if ((FOffset + TempSize) >= FBufferSize) and (Grow(TempSize) = 0) then
Result := 0
else
begin
TempPointer := Pointer(cardinal(FBuffer) + FOffset);
if ((FOffset + TempSize) >= FBufferSize) and (Grow(TempSize) = 0) then
Result := 0
else
begin
TempPointer := Pointer(cardinal(FBuffer) + FOffset);
Move(ptr^, TempPointer^, TempSize);
Move(ptr^, TempPointer^, TempSize);
FOffset := FOffset + TempSize;
Result := n;
end;
FOffset := FOffset + TempSize;
Result := n;
end;
LeaveCriticalSection(FCriticalSection);
finally
LeaveCriticalSection(FCriticalSection);
end;
end;
function TCefBytesWriteHandler.Seek(offset: Int64; whence: Integer): Integer;
@ -352,8 +347,8 @@ function TCefBytesWriteHandler.Grow(size : NativeUInt) : NativeUInt;
var
TempTotal : int64;
begin
EnterCriticalSection(FCriticalSection);
try
EnterCriticalSection(FCriticalSection);
if (size < FGrow) then
TempTotal := FGrow

View File

@ -35,7 +35,7 @@
*
*)
unit uCEFV8Exception;
unit uCEFv8Exception;
{$IFDEF FPC}
{$MODE OBJFPC}{$H+}

View File

@ -133,7 +133,7 @@ implementation
uses
uCEFMiscFunctions, uCEFLibFunctions, uCEFv8Accessor, uCEFv8Handler, uCEFv8Exception,
uCEFv8Interceptor, uCEFStringList, uCefv8ArrayBufferReleaseCallback;
uCEFv8Interceptor, uCEFStringList, uCEFv8ArrayBufferReleaseCallback;
function TCefv8ValueRef.AdjustExternallyAllocatedMemory(changeInBytes: Integer): Integer;
begin

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 61,
"InternalVersion" : 62,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "78.3.1.0"
}