mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-02 21:57:37 +02:00
Update to CEF 98.1.19
This commit is contained in:
parent
ef8d9e02c1
commit
6176fd8585
18
README.md
18
README.md
@ -3,16 +3,18 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro
|
|||||||
|
|
||||||
CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
|
CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
|
||||||
|
|
||||||
CEF4Delphi uses CEF 98.1.16 which includes Chromium 98.0.4758.55.
|
CEF4Delphi uses CEF 98.1.19 which includes Chromium 98.0.4758.80.
|
||||||
|
|
||||||
The CEF binaries used by CEF4Delphi are available for download at Spotify :
|
The CEF binaries used by CEF4Delphi are available for download at Spotify :
|
||||||
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.16%2Bg358ca26%2Bchromium-98.0.4758.55_windows32.tar.bz2)
|
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.19%2Bg57be9e2%2Bchromium-98.0.4758.80_windows32.tar.bz2)
|
||||||
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.16%2Bg358ca26%2Bchromium-98.0.4758.55_windows64.tar.bz2)
|
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.19%2Bg57be9e2%2Bchromium-98.0.4758.80_windows64.tar.bz2)
|
||||||
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.16%2Bg358ca26%2Bchromium-98.0.4758.55_linux32.tar.bz2)
|
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.19%2Bg57be9e2%2Bchromium-98.0.4758.80_linux32.tar.bz2)
|
||||||
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.16%2Bg358ca26%2Bchromium-98.0.4758.55_linux64.tar.bz2)
|
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.19%2Bg57be9e2%2Bchromium-98.0.4758.80_linux64.tar.bz2)
|
||||||
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.16%2Bg358ca26%2Bchromium-98.0.4758.55_linuxarm.tar.bz2)
|
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.19%2Bg57be9e2%2Bchromium-98.0.4758.80_linuxarm.tar.bz2)
|
||||||
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.16%2Bg358ca26%2Bchromium-98.0.4758.55_linuxarm64.tar.bz2)
|
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.19%2Bg57be9e2%2Bchromium-98.0.4758.80_linuxarm64.tar.bz2)
|
||||||
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.16%2Bg358ca26%2Bchromium-98.0.4758.55_macosx64.tar.bz2)
|
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_98.1.19%2Bg57be9e2%2Bchromium-98.0.4758.80_macosx64.tar.bz2)
|
||||||
|
|
||||||
|
Alternative download for the Windows 32 bits CEF binaries [click here](https://www.briskbard.com/cef/cef_binary_98.1.19+g57be9e2+chromium-98.0.4758.80_windows32.tar.bz2)
|
||||||
|
|
||||||
CEF4Delphi was developed and tested on Delphi 11.0 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3, Delphi 10.4 and Lazarus 2.2.0/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
CEF4Delphi was developed and tested on Delphi 11.0 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3, Delphi 10.4 and Lazarus 2.2.0/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
||||||
|
|
||||||
|
@ -225,7 +225,8 @@ contains
|
|||||||
uCEFTimerWorkScheduler in '..\source\uCEFTimerWorkScheduler.pas',
|
uCEFTimerWorkScheduler in '..\source\uCEFTimerWorkScheduler.pas',
|
||||||
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas',
|
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas',
|
||||||
uCEFOverlayController in '..\source\uCEFOverlayController.pas',
|
uCEFOverlayController in '..\source\uCEFOverlayController.pas',
|
||||||
uCEFFileDialogInfo in '..\source\uCEFFileDialogInfo.pas';
|
uCEFFileDialogInfo in '..\source\uCEFFileDialogInfo.pas',
|
||||||
|
uCEFArgCopy in '..\source\uCEFArgCopy.pas';
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -222,6 +222,7 @@ contains
|
|||||||
uCEFTimerWorkScheduler in '..\source\uCEFTimerWorkScheduler.pas',
|
uCEFTimerWorkScheduler in '..\source\uCEFTimerWorkScheduler.pas',
|
||||||
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas',
|
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas',
|
||||||
uCEFOverlayController in '..\source\uCEFOverlayController.pas',
|
uCEFOverlayController in '..\source\uCEFOverlayController.pas',
|
||||||
uCEFFileDialogInfo in '..\source\uCEFFileDialogInfo.pas';
|
uCEFFileDialogInfo in '..\source\uCEFFileDialogInfo.pas',
|
||||||
|
uCEFArgCopy in '..\source\uCEFArgCopy.pas';
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -237,7 +237,8 @@ contains
|
|||||||
uCEFMacOSInterfaces in '..\source\uCEFMacOSInterfaces.pas',
|
uCEFMacOSInterfaces in '..\source\uCEFMacOSInterfaces.pas',
|
||||||
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas',
|
uCEFFrameHandler in '..\source\uCEFFrameHandler.pas',
|
||||||
uCEFOverlayController in '..\source\uCEFOverlayController.pas',
|
uCEFOverlayController in '..\source\uCEFOverlayController.pas',
|
||||||
uCEFFileDialogInfo in '..\source\uCEFFileDialogInfo.pas';
|
uCEFFileDialogInfo in '..\source\uCEFFileDialogInfo.pas',
|
||||||
|
uCEFArgCopy in '..\source\uCEFArgCopy.pas';
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
<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."/>
|
<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"/>
|
<License Value="MPL 1.1"/>
|
||||||
<Version Major="98" Minor="1" Release="16"/>
|
<Version Major="98" Minor="1" Release="19"/>
|
||||||
<Files Count="203">
|
<Files Count="204">
|
||||||
<Item1>
|
<Item1>
|
||||||
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
||||||
<UnitName Value="uCEFAccessibilityHandler"/>
|
<UnitName Value="uCEFAccessibilityHandler"/>
|
||||||
@ -853,6 +853,10 @@
|
|||||||
<Filename Value="..\source\uCEFFileDialogInfo.pas"/>
|
<Filename Value="..\source\uCEFFileDialogInfo.pas"/>
|
||||||
<UnitName Value="uCEFFileDialogInfo"/>
|
<UnitName Value="uCEFFileDialogInfo"/>
|
||||||
</Item203>
|
</Item203>
|
||||||
|
<Item204>
|
||||||
|
<Filename Value="..\source\uCEFArgCopy.pas"/>
|
||||||
|
<UnitName Value="uCEFArgCopy"/>
|
||||||
|
</Item204>
|
||||||
</Files>
|
</Files>
|
||||||
<CompatibilityMode Value="True"/>
|
<CompatibilityMode Value="True"/>
|
||||||
<RequiredPkgs Count="5">
|
<RequiredPkgs Count="5">
|
||||||
|
@ -66,7 +66,7 @@ uses
|
|||||||
uCEFLinuxFunctions, uCEFLinuxTypes, uCEFLinuxConstants,
|
uCEFLinuxFunctions, uCEFLinuxTypes, uCEFLinuxConstants,
|
||||||
uCEFWorkSchedulerQueueThread, uCEFLinkedWinControlBase, uCEFLazarusCocoa,
|
uCEFWorkSchedulerQueueThread, uCEFLinkedWinControlBase, uCEFLazarusCocoa,
|
||||||
uCEFBrowserWindow, uCEFOsrBrowserWindow, uCEFTimerWorkScheduler,
|
uCEFBrowserWindow, uCEFOsrBrowserWindow, uCEFTimerWorkScheduler,
|
||||||
uCEFFrameHandler, uCEFOverlayController, uCEFFileDialogInfo,
|
uCEFFrameHandler, uCEFOverlayController, uCEFFileDialogInfo, uCEFArgCopy,
|
||||||
LazarusPackageIntf;
|
LazarusPackageIntf;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
@ -60,19 +60,21 @@ uses
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
{$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, {$IFDEF FPC}dynlibs,{$ENDIF}
|
{$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, {$IFDEF FPC}dynlibs,{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$IFDEF LINUX}{$IFDEF FPC}xlib,{$ENDIF}{$ENDIF}
|
{$IFDEF LINUX}
|
||||||
|
{$IFDEF FPC}xlib,{$ENDIF} uCEFArgCopy,
|
||||||
|
{$ENDIF}
|
||||||
uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar;
|
uCEFTypes, uCEFInterfaces, uCEFBaseRefCounted, uCEFSchemeRegistrar;
|
||||||
|
|
||||||
const
|
const
|
||||||
CEF_SUPPORTED_VERSION_MAJOR = 98;
|
CEF_SUPPORTED_VERSION_MAJOR = 98;
|
||||||
CEF_SUPPORTED_VERSION_MINOR = 1;
|
CEF_SUPPORTED_VERSION_MINOR = 1;
|
||||||
CEF_SUPPORTED_VERSION_RELEASE = 16;
|
CEF_SUPPORTED_VERSION_RELEASE = 19;
|
||||||
CEF_SUPPORTED_VERSION_BUILD = 0;
|
CEF_SUPPORTED_VERSION_BUILD = 0;
|
||||||
|
|
||||||
CEF_CHROMEELF_VERSION_MAJOR = 98;
|
CEF_CHROMEELF_VERSION_MAJOR = 98;
|
||||||
CEF_CHROMEELF_VERSION_MINOR = 0;
|
CEF_CHROMEELF_VERSION_MINOR = 0;
|
||||||
CEF_CHROMEELF_VERSION_RELEASE = 4758;
|
CEF_CHROMEELF_VERSION_RELEASE = 4758;
|
||||||
CEF_CHROMEELF_VERSION_BUILD = 55;
|
CEF_CHROMEELF_VERSION_BUILD = 80;
|
||||||
|
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
LIBCEF_DLL = 'libcef.dll';
|
LIBCEF_DLL = 'libcef.dll';
|
||||||
@ -194,6 +196,9 @@ type
|
|||||||
// Fields used during the CEF initialization
|
// Fields used during the CEF initialization
|
||||||
FWindowsSandboxInfo : pointer;
|
FWindowsSandboxInfo : pointer;
|
||||||
FEnableHighDPISupport : boolean;
|
FEnableHighDPISupport : boolean;
|
||||||
|
{$IFDEF LINUX}
|
||||||
|
FArgCopy : TCEFArgCopy;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
// Fields used by custom properties
|
// Fields used by custom properties
|
||||||
FDeleteCache : boolean;
|
FDeleteCache : boolean;
|
||||||
@ -287,6 +292,8 @@ type
|
|||||||
function GetApiHashCommit : ustring;
|
function GetApiHashCommit : ustring;
|
||||||
{$IFDEF LINUX}
|
{$IFDEF LINUX}
|
||||||
function GetXDisplay : PXDisplay;
|
function GetXDisplay : PXDisplay;
|
||||||
|
function GetArgc : longint;
|
||||||
|
function GetArgv : PPChar;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
function LoadCEFlibrary : boolean; virtual;
|
function LoadCEFlibrary : boolean; virtual;
|
||||||
@ -506,6 +513,10 @@ type
|
|||||||
// Properties used during the CEF initialization
|
// Properties used during the CEF initialization
|
||||||
property WindowsSandboxInfo : Pointer read FWindowsSandboxInfo write FWindowsSandboxInfo;
|
property WindowsSandboxInfo : Pointer read FWindowsSandboxInfo write FWindowsSandboxInfo;
|
||||||
property EnableHighDPISupport : boolean read FEnableHighDPISupport write FEnableHighDPISupport;
|
property EnableHighDPISupport : boolean read FEnableHighDPISupport write FEnableHighDPISupport;
|
||||||
|
{$IFDEF LINUX}
|
||||||
|
property argc : longint read GetArgc;
|
||||||
|
property argv : PPChar read GetArgv;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
// Custom properties
|
// Custom properties
|
||||||
property DeleteCache : boolean read FDeleteCache write FDeleteCache;
|
property DeleteCache : boolean read FDeleteCache write FDeleteCache;
|
||||||
@ -752,6 +763,9 @@ begin
|
|||||||
// Fields used during the CEF initialization
|
// Fields used during the CEF initialization
|
||||||
FWindowsSandboxInfo := nil;
|
FWindowsSandboxInfo := nil;
|
||||||
FEnableHighDPISupport := False;
|
FEnableHighDPISupport := False;
|
||||||
|
{$IFDEF LINUX}
|
||||||
|
FArgCopy := TCEFArgCopy.Create;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
// Fields used by custom properties
|
// Fields used by custom properties
|
||||||
FDeleteCache := False;
|
FDeleteCache := False;
|
||||||
@ -850,6 +864,9 @@ begin
|
|||||||
|
|
||||||
FreeLibcefLibrary;
|
FreeLibcefLibrary;
|
||||||
|
|
||||||
|
{$IFDEF LINUX}
|
||||||
|
if (FArgCopy <> nil) then FreeAndNil(FArgCopy);
|
||||||
|
{$ENDIF}
|
||||||
if (FCustomCommandLines <> nil) then FreeAndNil(FCustomCommandLines);
|
if (FCustomCommandLines <> nil) then FreeAndNil(FCustomCommandLines);
|
||||||
if (FCustomCommandLineValues <> nil) then FreeAndNil(FCustomCommandLineValues);
|
if (FCustomCommandLineValues <> nil) then FreeAndNil(FCustomCommandLineValues);
|
||||||
finally
|
finally
|
||||||
@ -1341,8 +1358,11 @@ begin
|
|||||||
TempArgs.instance := HINSTANCE{$IFDEF FPC}(){$ENDIF};
|
TempArgs.instance := HINSTANCE{$IFDEF FPC}(){$ENDIF};
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
TempArgs.argc := argc;
|
{$IFDEF LINUX}
|
||||||
TempArgs.argv := argv;
|
FArgCopy.CopyFromArgs(argc, argv);
|
||||||
|
{$ENDIF}
|
||||||
|
TempArgs.argc := argc;
|
||||||
|
TempArgs.argv := argv;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
TempArgs.argc := ArgCount;
|
TempArgs.argc := ArgCount;
|
||||||
TempArgs.argv := PPWideChar(ArgValues);
|
TempArgs.argv := PPWideChar(ArgValues);
|
||||||
@ -2081,12 +2101,14 @@ begin
|
|||||||
// The list of features you can enable is here :
|
// The list of features you can enable is here :
|
||||||
// https://chromium.googlesource.com/chromium/src/+/master/chrome/common/chrome_features.cc
|
// https://chromium.googlesource.com/chromium/src/+/master/chrome/common/chrome_features.cc
|
||||||
// https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/content_features.cc
|
// https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/content_features.cc
|
||||||
|
// https://source.chromium.org/search?q=base::Feature
|
||||||
if (length(FEnableFeatures) > 0) then
|
if (length(FEnableFeatures) > 0) then
|
||||||
AppendSwitch(aKeys, aValues, '--enable-features', FEnableFeatures);
|
AppendSwitch(aKeys, aValues, '--enable-features', FEnableFeatures);
|
||||||
|
|
||||||
// The list of features you can disable is here :
|
// The list of features you can disable is here :
|
||||||
// https://chromium.googlesource.com/chromium/src/+/master/chrome/common/chrome_features.cc
|
// https://chromium.googlesource.com/chromium/src/+/master/chrome/common/chrome_features.cc
|
||||||
// https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/content_features.cc
|
// https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/content_features.cc
|
||||||
|
// https://source.chromium.org/search?q=base::Feature
|
||||||
if (length(FDisableFeatures) > 0) then
|
if (length(FDisableFeatures) > 0) then
|
||||||
AppendSwitch(aKeys, aValues, '--disable-features', FDisableFeatures);
|
AppendSwitch(aKeys, aValues, '--disable-features', FDisableFeatures);
|
||||||
|
|
||||||
@ -2307,13 +2329,13 @@ begin
|
|||||||
TempProcHWND := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, False, TempProcess.th32ProcessID);
|
TempProcHWND := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, False, TempProcess.th32ProcessID);
|
||||||
|
|
||||||
if (TempProcHWND <> 0) then
|
if (TempProcHWND <> 0) then
|
||||||
begin
|
try
|
||||||
ZeroMemory(@TempMemCtrs, SizeOf(TProcessMemoryCounters));
|
ZeroMemory(@TempMemCtrs, SizeOf(TProcessMemoryCounters));
|
||||||
TempMemCtrs.cb := SizeOf(TProcessMemoryCounters);
|
TempMemCtrs.cb := SizeOf(TProcessMemoryCounters);
|
||||||
|
|
||||||
if GetProcessMemoryInfo(TempProcHWND, {$IFNDEF FPC}@{$ENDIF}TempMemCtrs, TempMemCtrs.cb) then
|
if GetProcessMemoryInfo(TempProcHWND, {$IFNDEF FPC}@{$ENDIF}TempMemCtrs, TempMemCtrs.cb) then
|
||||||
inc(Result, TempMemCtrs.WorkingSetSize);
|
inc(Result, TempMemCtrs.WorkingSetSize);
|
||||||
|
finally
|
||||||
CloseHandle(TempProcHWND);
|
CloseHandle(TempProcHWND);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2418,6 +2440,22 @@ begin
|
|||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCefApplicationCore.GetArgc : longint;
|
||||||
|
begin
|
||||||
|
if (FArgCopy <> nil) then
|
||||||
|
Result := FArgCopy.argc
|
||||||
|
else
|
||||||
|
Result := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCefApplicationCore.GetArgv : PPChar;
|
||||||
|
begin
|
||||||
|
if (FArgCopy <> nil) then
|
||||||
|
Result := FArgCopy.argv
|
||||||
|
else
|
||||||
|
Result := nil;
|
||||||
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
function TCefApplicationCore.LoadCEFlibrary : boolean;
|
function TCefApplicationCore.LoadCEFlibrary : boolean;
|
||||||
|
148
source/uCEFArgCopy.pas
Normal file
148
source/uCEFArgCopy.pas
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
// ************************************************************************
|
||||||
|
// ***************************** CEF4Delphi *******************************
|
||||||
|
// ************************************************************************
|
||||||
|
//
|
||||||
|
// CEF4Delphi is based on DCEF3 which uses CEF 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
|
||||||
|
//
|
||||||
|
// Copyright © 2022 Salvador Diaz Fau. All rights reserved.
|
||||||
|
//
|
||||||
|
// ************************************************************************
|
||||||
|
// ************ 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 uCEFArgCopy;
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE OBJFPC}{$H+}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFNDEF CPUX64}{$ALIGN ON}{$ENDIF}
|
||||||
|
{$MINENUMSIZE 4}
|
||||||
|
|
||||||
|
{$I cef.inc}
|
||||||
|
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF DELPHI16_UP}
|
||||||
|
System.Classes, System.SysUtils;
|
||||||
|
{$ELSE}
|
||||||
|
Classes, SysUtils;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
type
|
||||||
|
TCEFArgCopy = class
|
||||||
|
protected
|
||||||
|
FArgCCopy : longint;
|
||||||
|
FArgVCopy : PPChar;
|
||||||
|
|
||||||
|
procedure InitializeFields;
|
||||||
|
procedure DestroyFields;
|
||||||
|
|
||||||
|
public
|
||||||
|
constructor Create;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure CopyFromArgs(aArgc : longint; aArgv : PPChar);
|
||||||
|
|
||||||
|
property argc : longint read FArgCCopy;
|
||||||
|
property argv : PPChar read FArgVCopy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$POINTERMATH ON}
|
||||||
|
|
||||||
|
constructor TCEFArgCopy.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
|
||||||
|
InitializeFields;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TCEFArgCopy.Destroy;
|
||||||
|
begin
|
||||||
|
DestroyFields;
|
||||||
|
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEFArgCopy.InitializeFields;
|
||||||
|
begin
|
||||||
|
FArgCCopy := 0;
|
||||||
|
FArgVCopy := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEFArgCopy.DestroyFields;
|
||||||
|
var
|
||||||
|
i : integer;
|
||||||
|
begin
|
||||||
|
if (FArgVCopy <> nil) then
|
||||||
|
begin
|
||||||
|
i := pred(FArgCCopy);
|
||||||
|
|
||||||
|
while (i >= 0) do
|
||||||
|
begin
|
||||||
|
if (FArgVCopy[i] <> nil) then
|
||||||
|
StrDispose(FArgVCopy[i]);
|
||||||
|
|
||||||
|
dec(i);
|
||||||
|
end;
|
||||||
|
|
||||||
|
FreeMem(FArgVCopy);
|
||||||
|
end;
|
||||||
|
|
||||||
|
InitializeFields;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEFArgCopy.CopyFromArgs(aArgc : longint; aArgv : PPChar);
|
||||||
|
var
|
||||||
|
i : integer;
|
||||||
|
begin
|
||||||
|
DestroyFields;
|
||||||
|
|
||||||
|
if (aArgc > 0) and (aArgv <> nil) then
|
||||||
|
begin
|
||||||
|
i := 0;
|
||||||
|
FArgCCopy := aArgc;
|
||||||
|
|
||||||
|
GetMem(FArgVCopy, (FArgCCopy + 1) * SizeOf(Pointer));
|
||||||
|
|
||||||
|
while (i < aArgc) do
|
||||||
|
begin
|
||||||
|
FArgVCopy[i] := StrAlloc(length(aArgv[i]) + 1);
|
||||||
|
StrCopy(FArgVCopy[i], aArgv[i]);
|
||||||
|
|
||||||
|
inc(i);
|
||||||
|
end;
|
||||||
|
|
||||||
|
FArgVCopy[i] := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
@ -2,9 +2,9 @@
|
|||||||
"UpdateLazPackages" : [
|
"UpdateLazPackages" : [
|
||||||
{
|
{
|
||||||
"ForceNotify" : true,
|
"ForceNotify" : true,
|
||||||
"InternalVersion" : 354,
|
"InternalVersion" : 355,
|
||||||
"Name" : "cef4delphi_lazarus.lpk",
|
"Name" : "cef4delphi_lazarus.lpk",
|
||||||
"Version" : "98.1.16.0"
|
"Version" : "98.1.19.0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"UpdatePackageData" : {
|
"UpdatePackageData" : {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user