diff --git a/README.md b/README.md index 68285f09..707ce064 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/source/cef.inc b/source/cef.inc index da947a0a..87688d68 100644 --- a/source/cef.inc +++ b/source/cef.inc @@ -451,7 +451,8 @@ {$DEFINE DELPHI25_UP} {$DEFINE DELPHI26_UP} {$DEFINE DELPHI27_UP} - {$DEFINE DELPHI28_UP} + {$DEFINE DELPHI28_UP} + {$DEFINE DELPHI29_UP} {$ENDIF} {$ENDIF} diff --git a/source/uCEFApplicationCore.pas b/source/uCEFApplicationCore.pas index c1b0f830..1484ac1f 100644 --- a/source/uCEFApplicationCore.pas +++ b/source/uCEFApplicationCore.pas @@ -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 diff --git a/source/uCEFBufferPanel.pas b/source/uCEFBufferPanel.pas index a900dfd8..43f0e629 100644 --- a/source/uCEFBufferPanel.pas +++ b/source/uCEFBufferPanel.pas @@ -353,7 +353,9 @@ type property BevelKind; property Ctl3D; property Locked; + {$IFDEF DELPHI7_UP} property ParentBackground; + {$ENDIF} property ParentCtl3D; property OnCanResize; {$ENDIF} diff --git a/source/uCEFCommandLine.pas b/source/uCEFCommandLine.pas index 554ed4ac..20b6c6bc 100644 --- a/source/uCEFCommandLine.pas +++ b/source/uCEFCommandLine.pas @@ -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) diff --git a/source/uCEFDomNode.pas b/source/uCEFDomNode.pas index ec0ccd8e..bcba5b5d 100644 --- a/source/uCEFDomNode.pas +++ b/source/uCEFDomNode.pas @@ -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) diff --git a/source/uCEFMiscFunctions.pas b/source/uCEFMiscFunctions.pas index f9f1e4d5..1ced4bc2 100644 --- a/source/uCEFMiscFunctions.pas +++ b/source/uCEFMiscFunctions.pas @@ -817,6 +817,10 @@ function GetCommandLineSwitchValue(const aKey : string; var aValue : ustring) : /// 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. diff --git a/source/uCEFOLEDragAndDrop.pas b/source/uCEFOLEDragAndDrop.pas index 048c2380..c08703a8 100644 --- a/source/uCEFOLEDragAndDrop.pas +++ b/source/uCEFOLEDragAndDrop.pas @@ -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; diff --git a/source/uCEFTypes.pas b/source/uCEFTypes.pas index c4463b21..f6e257d5 100644 --- a/source/uCEFTypes.pas +++ b/source/uCEFTypes.pas @@ -733,6 +733,10 @@ type /// ustring = type WideString; rbstring = type AnsiString; + {$IFNDEF DELPHI7_UP} + uint64 = type int64; + PPAnsiChar = array of PChar; + {$ENDIF} {$ELSE} /// /// String type used by CEF. ustring was created to use the same type in Delphi and Lazarus. diff --git a/update_CEF4Delphi.json b/update_CEF4Delphi.json index cac5e4ab..aabe7153 100644 --- a/update_CEF4Delphi.json +++ b/update_CEF4Delphi.json @@ -2,7 +2,7 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 575, + "InternalVersion" : 576, "Name" : "cef4delphi_lazarus.lpk", "Version" : "122.1.13" }