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

Fixed some GTK2 demos

Added Lazarus 3.4 mention in the readme
Added CefKeyEventLog calls in SimpleOSRBrowser to log keyboard events.
This commit is contained in:
Salvador Díaz Fau 2024-05-29 17:25:15 +02:00
parent e3cd6821c8
commit 013bbe441c
28 changed files with 86 additions and 50 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_125.0.19%2Bg3d8f1c9%2Bchromium-125.0.6422.112_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_125.0.19%2Bg3d8f1c9%2Bchromium-125.0.6422.112_macosx64.tar.bz2)
CEF4Delphi was developed and tested on Delphi 12.1 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 was developed and tested on Delphi 12.1 and it has been tested in Delphi 6, Delphi XE, Delphi 10, Delphi 11 and Lazarus 3.4/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

@ -215,6 +215,7 @@ begin
GlobalCEFApp.EnableGPU := True;
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE;
//GlobalCEFApp.ChromeRuntime := True;
// If you need transparency leave the GlobalCEFApp.BackgroundColor property
// with the default value or set the alpha channel to 0
@ -288,7 +289,9 @@ begin
TempKeyEvent.character := #0;
TempKeyEvent.unmodified_character := #0;
TempKeyEvent.focus_on_editable_field := ord(False);
{$IFDEF DEBUG}
CefKeyEventLog(TempKeyEvent);
{$ENDIF}
chrmosr.SendKeyEvent(@TempKeyEvent);
Handled := (Msg.wParam in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]);
end;
@ -304,7 +307,9 @@ begin
TempKeyEvent.character := #0;
TempKeyEvent.unmodified_character := #0;
TempKeyEvent.focus_on_editable_field := ord(False);
{$IFDEF DEBUG}
CefKeyEventLog(TempKeyEvent);
{$ENDIF}
chrmosr.SendKeyEvent(@TempKeyEvent);
end;
@ -321,6 +326,9 @@ begin
TempKeyEvent.focus_on_editable_field := ord(False);
CefCheckAltGrPressed(Msg.wParam, TempKeyEvent);
{$IFDEF DEBUG}
CefKeyEventLog(TempKeyEvent);
{$ENDIF}
chrmosr.SendKeyEvent(@TempKeyEvent);
end;

View File

@ -63,6 +63,9 @@
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -10,7 +10,7 @@ object Form1: TForm1
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '2.2.2.0'
LCLVersion = '3.4.0.0'
object AddressPnl: TPanel
Left = 0
Height = 23
@ -29,8 +29,8 @@ object Form1: TForm1
Width = 35
Align = alRight
Caption = 'Go'
OnClick = GoBtnClick
TabOrder = 0
OnClick = GoBtnClick
end
object AddressEdt: TEdit
Left = 0

View File

@ -104,7 +104,7 @@ procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.ExternalMessagePump := True;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.OnScheduleMessagePumpWork := @GlobalCEFApp_OnScheduleMessagePumpWork;
// This is a workaround for the 'GPU is not usable error' issue :

View File

@ -15,7 +15,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
OnCreate = FormCreate
OnDestroy = FormDestroy
Position = poScreenCenter
LCLVersion = '2.2.0.4'
LCLVersion = '3.4.0.0'
object NavControlPnl: TPanel
Left = 0
Height = 25
@ -26,6 +26,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
ClientHeight = 25
ClientWidth = 1184
Enabled = False
ParentBackground = False
TabOrder = 0
object NavButtonPnl: TPanel
Left = 0
@ -36,6 +37,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
BevelOuter = bvNone
ClientHeight = 25
ClientWidth = 133
ParentBackground = False
TabOrder = 0
object BackBtn: TButton
Left = 8
@ -47,9 +49,9 @@ object MiniBrowserFrm: TMiniBrowserFrm
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
OnClick = BackBtnClick
ParentFont = False
TabOrder = 0
OnClick = BackBtnClick
end
object ForwardBtn: TButton
Left = 39
@ -61,9 +63,9 @@ object MiniBrowserFrm: TMiniBrowserFrm
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
OnClick = ForwardBtnClick
ParentFont = False
TabOrder = 1
OnClick = ForwardBtnClick
end
object ReloadBtn: TButton
Left = 70
@ -75,9 +77,9 @@ object MiniBrowserFrm: TMiniBrowserFrm
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
OnClick = ReloadBtnClick
ParentFont = False
TabOrder = 2
OnClick = ReloadBtnClick
end
object StopBtn: TButton
Left = 101
@ -89,9 +91,9 @@ object MiniBrowserFrm: TMiniBrowserFrm
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Webdings'
OnClick = StopBtnClick
ParentFont = False
TabOrder = 3
OnClick = StopBtnClick
end
end
object URLEditPnl: TPanel
@ -103,6 +105,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
BevelOuter = bvNone
ClientHeight = 25
ClientWidth = 978
ParentBackground = False
TabOrder = 1
object URLCbx: TComboBox
Left = 0
@ -167,6 +170,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
BevelOuter = bvNone
ClientHeight = 25
ClientWidth = 73
ParentBackground = False
TabOrder = 2
object ConfigBtn: TButton
Left = 40
@ -179,9 +183,9 @@ object MiniBrowserFrm: TMiniBrowserFrm
Font.Height = -17
Font.Name = 'Arial'
Font.Style = [fsBold]
OnClick = ConfigBtnClick
ParentFont = False
TabOrder = 0
OnClick = ConfigBtnClick
end
object GoBtn: TButton
Left = 8
@ -195,16 +199,16 @@ object MiniBrowserFrm: TMiniBrowserFrm
Font.Height = -17
Font.Name = 'Arial'
Font.Style = [fsBold]
OnClick = GoBtnClick
ParentFont = False
TabOrder = 1
OnClick = GoBtnClick
end
end
end
object StatusBar1: TStatusBar
Left = 0
Height = 17
Top = 695
Height = 18
Top = 694
Width = 1184
Panels = <
item
@ -214,7 +218,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
end
object CEFLinkedWindowParent1: TCEFLinkedWindowParent
Left = 0
Height = 670
Height = 669
Top = 25
Width = 1184
Align = alClient

View File

@ -228,7 +228,8 @@ begin
GlobalCEFApp.cache := 'cache';
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
//GlobalCEFApp.EnablePrintPreview := True;
GlobalCEFApp.EnablePrintPreview := True;
GlobalCEFApp.ChromeRuntime := True;
end;
{Property setters and getters}

View File

@ -64,6 +64,9 @@
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="OSRExternalPumpBrowser_sp"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
@ -23,7 +23,6 @@
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="1">
<Item1>

View File

@ -11,7 +11,6 @@ uses
begin
GlobalCEFApp := TCefApplicationCore.Create;
GlobalCEFApp.WindowlessRenderingEnabled := True;
GlobalCEFApp.EnableHighDPISupport := True;
GlobalCEFApp.ExternalMessagePump := True;
GlobalCEFApp.MultiThreadedMessageLoop := False;

View File

@ -12,7 +12,7 @@ object Form1: TForm1
OnDestroy = FormDestroy
OnHide = FormHide
OnShow = FormShow
LCLVersion = '2.2.2.0'
LCLVersion = '3.4.0.0'
object AddressPnl: TPanel
Left = 0
Height = 30
@ -29,9 +29,9 @@ object Form1: TForm1
Top = 1
Width = 933
Align = alClient
OnEnter = AddressEdtEnter
TabOrder = 0
Text = 'https://www.google.com'
OnEnter = AddressEdtEnter
end
object Panel2: TPanel
Left = 934
@ -49,9 +49,9 @@ object Form1: TForm1
Width = 31
Align = alLeft
Caption = 'Go'
TabOrder = 0
OnClick = GoBtnClick
OnEnter = GoBtnEnter
TabOrder = 0
end
object SnapshotBtn: TButton
Left = 34
@ -62,10 +62,10 @@ object Form1: TForm1
Caption = 'µ'
Font.Height = -24
Font.Name = 'Webdings'
OnClick = SnapshotBtnClick
OnEnter = GoBtnEnter
ParentFont = False
TabOrder = 1
OnClick = SnapshotBtnClick
OnEnter = GoBtnEnter
end
end
end

View File

@ -175,7 +175,6 @@ procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.WindowlessRenderingEnabled := True;
GlobalCEFApp.EnableHighDPISupport := True;
GlobalCEFApp.BrowserSubprocessPath := 'OSRExternalPumpBrowser_sp';
GlobalCEFApp.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF);
GlobalCEFApp.ExternalMessagePump := True;

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="OSRExternalPumpBrowser2_sp"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
@ -23,7 +23,6 @@
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="1">
<Item1>

View File

@ -11,7 +11,6 @@ uses
begin
GlobalCEFApp := TCefApplicationCore.Create;
GlobalCEFApp.WindowlessRenderingEnabled := True;
GlobalCEFApp.EnableHighDPISupport := True;
GlobalCEFApp.ExternalMessagePump := True;
GlobalCEFApp.MultiThreadedMessageLoop := False;

View File

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="SimpleBrowser"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
@ -23,7 +25,6 @@
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="2">
<Item1>
@ -62,6 +63,9 @@
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="SimpleBrowser2"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
@ -23,7 +25,6 @@
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="2">
<Item1>
@ -63,6 +64,9 @@
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="SimpleOSRBrowser"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
@ -23,7 +25,6 @@
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="2">
<Item1>
@ -63,6 +64,9 @@
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -13,7 +13,7 @@ object Form1: TForm1
OnHide = FormHide
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '2.0.10.0'
LCLVersion = '3.4.0.0'
object AddressPnl: TPanel
Left = 0
Height = 30
@ -29,9 +29,9 @@ object Form1: TForm1
Top = 1
Width = 932
Align = alClient
OnEnter = AddressEdtEnter
TabOrder = 0
Text = 'https://www.google.com'
OnEnter = AddressEdtEnter
end
object Panel2: TPanel
Left = 933
@ -49,9 +49,9 @@ object Form1: TForm1
Width = 31
Align = alLeft
Caption = 'Go'
TabOrder = 0
OnClick = GoBtnClick
OnEnter = GoBtnEnter
TabOrder = 0
end
object SnapshotBtn: TButton
Left = 34
@ -62,10 +62,10 @@ object Form1: TForm1
Caption = 'µ'
Font.Height = -24
Font.Name = 'Webdings'
OnClick = SnapshotBtnClick
OnEnter = GoBtnEnter
ParentFont = False
TabOrder = 1
OnClick = SnapshotBtnClick
OnEnter = GoBtnEnter
end
end
end

View File

@ -203,7 +203,6 @@ procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.WindowlessRenderingEnabled := True;
GlobalCEFApp.EnableHighDPISupport := True;
GlobalCEFApp.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF);
//GlobalCEFApp.LogFile := 'debug.log';

View File

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="SubProcess"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
@ -23,7 +25,6 @@
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="2">
<Item1>
@ -62,6 +63,9 @@
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -119,6 +119,7 @@ end;
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.ChromeRuntime := True;
GlobalCEFApp.OnContextInitialized := @GlobalCEFApp_OnContextInitialized;
end;

View File

@ -59,6 +59,9 @@
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -61,6 +61,9 @@
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 600,
"InternalVersion" : 601,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "125.0.19"
}