mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2024-11-24 08:02:15 +02:00
Added Delphi 6 support thanks to andreluisfc
This commit is contained in:
parent
76d3880633
commit
16639d5ea5
@ -13,7 +13,7 @@ The CEF binaries used by CEF4Delphi are available for download at Spotify :
|
||||
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_122.1.13%2Bgde5b724%2Bchromium-122.0.6261.130_linuxarm64.tar.bz2)
|
||||
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_122.1.13%2Bgde5b724%2Bchromium-122.0.6261.130_macosx64.tar.bz2)
|
||||
|
||||
CEF4Delphi was developed and tested on Delphi 12.0 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 11 and Lazarus 3.2/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
||||
CEF4Delphi was developed and tested on Delphi 12.0 and it has been tested in Delphi 6, Delphi XE, Delphi 10, Delphi 11 and Lazarus 3.2/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
||||
|
||||
CEF4Delphi demos have been tested in Windows 10, Windows 11, Linux Mint 21.3 and Raspberry Pi OS.
|
||||
|
||||
|
@ -451,7 +451,8 @@
|
||||
{$DEFINE DELPHI25_UP}
|
||||
{$DEFINE DELPHI26_UP}
|
||||
{$DEFINE DELPHI27_UP}
|
||||
{$DEFINE DELPHI28_UP}
|
||||
{$DEFINE DELPHI28_UP}
|
||||
{$DEFINE DELPHI29_UP}
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
|
||||
|
@ -3154,7 +3154,11 @@ end;
|
||||
procedure TCefApplicationCore.AddCustomCommandLineSwitches(var aKeys, aValues : TStringList);
|
||||
var
|
||||
i : integer;
|
||||
{$IFDEF VER140}
|
||||
TempDecimalSeparator : char; // Only for Delphi 6
|
||||
{$ELSE}
|
||||
TempFormatSettings : TFormatSettings;
|
||||
{$ENDIF}
|
||||
begin
|
||||
if FEnableMediaStream then
|
||||
ReplaceSwitch(aKeys, aValues, '--enable-media-stream');
|
||||
@ -3298,15 +3302,23 @@ begin
|
||||
begin
|
||||
{$IFDEF FPC}
|
||||
TempFormatSettings.DecimalSeparator := '.';
|
||||
ReplaceSwitch(aKeys, aValues, '--force-device-scale-factor', FloatToStr(FForcedDeviceScaleFactor, TempFormatSettings));
|
||||
{$ELSE}
|
||||
{$IFDEF DELPHI24_UP}
|
||||
TempFormatSettings := TFormatSettings.Create('en-US');
|
||||
{$IFDEF DELPHI7_UP}
|
||||
{$IFDEF DELPHI24_UP}
|
||||
TempFormatSettings := TFormatSettings.Create('en-US');
|
||||
{$ELSE}
|
||||
GetLocaleFormatSettings(GetThreadLocale, TempFormatSettings);
|
||||
TempFormatSettings.DecimalSeparator := '.';
|
||||
{$ENDIF}
|
||||
ReplaceSwitch(aKeys, aValues, '--force-device-scale-factor', FloatToStr(FForcedDeviceScaleFactor, TempFormatSettings));
|
||||
{$ELSE}
|
||||
GetLocaleFormatSettings(GetThreadLocale, TempFormatSettings);
|
||||
TempFormatSettings.DecimalSeparator := '.';
|
||||
TempDecimalSeparator := DecimalSeparator;
|
||||
DecimalSeparator := '.';
|
||||
ReplaceSwitch(aKeys, aValues, '--force-device-scale-factor', FloatToStr(FForcedDeviceScaleFactor));
|
||||
DecimalSeparator := TempDecimalSeparator;
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
ReplaceSwitch(aKeys, aValues, '--force-device-scale-factor', FloatToStr(FForcedDeviceScaleFactor, TempFormatSettings));
|
||||
end;
|
||||
|
||||
if FDisableZygote then
|
||||
|
@ -353,7 +353,9 @@ type
|
||||
property BevelKind;
|
||||
property Ctl3D;
|
||||
property Locked;
|
||||
{$IFDEF DELPHI7_UP}
|
||||
property ParentBackground;
|
||||
{$ENDIF}
|
||||
property ParentCtl3D;
|
||||
property OnCanResize;
|
||||
{$ENDIF}
|
||||
|
@ -154,7 +154,11 @@ begin
|
||||
TempValue := TempStrMap.Value[i];
|
||||
|
||||
if (length(TempKey) > 0) and (length(TempValue) > 0) then
|
||||
{$IFDEF VER140}
|
||||
switches.Add(TempKey + '=' + TempValue) // Only for Delphi 6
|
||||
{$ELSE}
|
||||
switches.Add(TempKey + switches.NameValueSeparator + TempValue)
|
||||
{$ENDIF}
|
||||
else
|
||||
if (length(TempKey) > 0) then
|
||||
switches.Add(TempKey)
|
||||
|
@ -106,7 +106,11 @@ begin
|
||||
TempValue := TempStrMap.Value[i];
|
||||
|
||||
if (length(TempKey) > 0) and (length(TempValue) > 0) then
|
||||
{$IFDEF VER140}
|
||||
attrList.Add(TempKey + '=' + TempValue) // Only for Delphi 6
|
||||
{$ELSE}
|
||||
attrList.Add(TempKey + attrList.NameValueSeparator + TempValue)
|
||||
{$ENDIF}
|
||||
else
|
||||
if (length(TempKey) > 0) then
|
||||
attrList.Add(TempKey)
|
||||
|
@ -817,6 +817,10 @@ function GetCommandLineSwitchValue(const aKey : string; var aValue : ustring) :
|
||||
/// </summary>
|
||||
function IsCEFSubprocess : boolean;
|
||||
|
||||
{$IFNDEF FPC}{$IFNDEF DELPHI7_UP}
|
||||
function PosEx(const SubStr, S: string; Offset: Cardinal = 1): Integer;
|
||||
{$ENDIF}{$ENDIF}
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
@ -3443,4 +3447,20 @@ begin
|
||||
Result := GetCommandLineSwitchValue('type', TempValue) and (length(TempValue) > 0);
|
||||
end;
|
||||
|
||||
{$IFNDEF FPC}{$IFNDEF DELPHI7_UP}
|
||||
function PosEx(const SubStr, S: string; Offset: Cardinal = 1): Integer;
|
||||
var
|
||||
TempString : string;
|
||||
begin
|
||||
if Offset <= 1 then
|
||||
Result := Pos(SubStr, S)
|
||||
else
|
||||
begin
|
||||
TempString := copy(S, Offset, length(S));
|
||||
Result := Pos(SubStr, TempString);
|
||||
if (Result > 0) then inc(Result, Offset - 1);
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}{$ENDIF}
|
||||
|
||||
end.
|
||||
|
@ -15,10 +15,11 @@ interface
|
||||
|
||||
uses
|
||||
{$IFDEF DELPHI16_UP}
|
||||
{$IFDEF MSWINDOWS}WinApi.Windows, WinApi.ShlObj, WinApi.ActiveX,{$ENDIF} System.Classes, System.Math;
|
||||
{$IFDEF MSWINDOWS}WinApi.Windows, WinApi.ShlObj, WinApi.ActiveX,{$ENDIF} System.Classes, System.Math,
|
||||
{$ELSE}
|
||||
{$IFDEF MSWINDOWS}Windows, ShlObj, ActiveX,{$ENDIF} Classes, Math;
|
||||
{$IFDEF MSWINDOWS}Windows, ShlObj, ActiveX,{$ENDIF} Classes, Math,
|
||||
{$ENDIF}
|
||||
uCEFTypes;
|
||||
|
||||
const
|
||||
CUSTOM_ARRAY_LENGTH = 25;
|
||||
|
@ -733,6 +733,10 @@ type
|
||||
/// </summary>
|
||||
ustring = type WideString;
|
||||
rbstring = type AnsiString;
|
||||
{$IFNDEF DELPHI7_UP}
|
||||
uint64 = type int64;
|
||||
PPAnsiChar = array of PChar;
|
||||
{$ENDIF}
|
||||
{$ELSE}
|
||||
/// <summary>
|
||||
/// String type used by CEF. ustring was created to use the same type in Delphi and Lazarus.
|
||||
|
@ -2,7 +2,7 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 575,
|
||||
"InternalVersion" : 576,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "122.1.13"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user