Added Delphi 6 support thanks to andreluisfc

This commit is contained in:
Salvador Díaz Fau 2024-03-23 18:21:32 +01:00
parent 76d3880633
commit 16639d5ea5
10 changed files with 58 additions and 10 deletions

View File

@ -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.

View File

@ -451,7 +451,8 @@
{$DEFINE DELPHI25_UP}
{$DEFINE DELPHI26_UP}
{$DEFINE DELPHI27_UP}
{$DEFINE DELPHI28_UP}
{$DEFINE DELPHI28_UP}
{$DEFINE DELPHI29_UP}
{$ENDIF}
{$ENDIF}

View File

@ -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

View File

@ -353,7 +353,9 @@ type
property BevelKind;
property Ctl3D;
property Locked;
{$IFDEF DELPHI7_UP}
property ParentBackground;
{$ENDIF}
property ParentCtl3D;
property OnCanResize;
{$ENDIF}

View File

@ -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)

View File

@ -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)

View File

@ -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.

View File

@ -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;

View File

@ -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.

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 575,
"InternalVersion" : 576,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "122.1.13"
}