Recent

Author Topic: CEF3 or 4 - the next step  (Read 731 times)

Nicole

  • Hero Member
  • *****
  • Posts: 1271
CEF3 or 4 - the next step
« on: October 07, 2025, 02:41:38 pm »
Not sure, which is the "perfect" header for this question.

The question is related with this one:
https://forum.lazarus.freepascal.org/index.php/topic,71856.msg566025.html#msg566025

Paweld was so kind to post various things. A bundle of files and a demo
The good news: The "simple browser" works as exe, when I start it directly in the bundle of files.
I started it in a Win 7 VM - a start.

My target was to write an app.

I installed in my Laz 4.0 the CEF-component.
Those mass of error-messages about missing files is gone, which I saw before, but I read:

Code: Text  [Select][+][-]
  1. CEF binaries missing !
  2. The missing files are :
  3. swiftshader\libEGL.dll
  4. swiftshader\libGLESv2.dll

As it is hard to find the correct directory and the correct file, I would assume, that there shall be a directory "swiftshader" on the same level as "local". Right?

Where can I get the files from?
They should be CE3 for Win 7, but where to find?

Thaddy

  • Hero Member
  • *****
  • Posts: 18306
  • Here stood a man who saw the Elbe and jumped it.
Re: CEF3 or 4 - the next step
« Reply #1 on: October 07, 2025, 04:53:46 pm »
EGL is a LINUX graphics very low level subsystem. If the code for Windows demands it, it is bad code. It is such low level this may apply to many more platforms but not to Windows. (I do not know of an emulation layer for EGL on Windows)
« Last Edit: October 07, 2025, 04:57:02 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

cdbc

  • Hero Member
  • *****
  • Posts: 2464
    • http://www.cdbc.dk
Re: CEF3 or 4 - the next step
« Reply #2 on: October 07, 2025, 05:06:09 pm »
Hi
EGL -- Sounds like Enlightenment Graphics Library --  %)
...But I can very well be mistaken...  ;D
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6 -> FPC 3.2.2 -> Lazarus 4.0 up until Jan 2025 from then on it's both above &: KDE6/QT6 -> FPC 3.3.1 -> Lazarus 4.99

salvadordf

  • Jr. Member
  • **
  • Posts: 68
    • BriskBard
Re: CEF3 or 4 - the next step
« Reply #3 on: October 07, 2025, 05:56:58 pm »
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects

paweld

  • Hero Member
  • *****
  • Posts: 1484
Re: CEF3 or 4 - the next step
« Reply #4 on: October 07, 2025, 06:08:49 pm »
The component is called CEF4Delphi. There is also a component called fpCEF3 ( https://wiki.lazarus.freepascal.org/fpCEF3 ), but it is no longer maintained.

The files you mention are only needed for the application to run. Lazarus does not require them after installing the CEF4Delphi component.

Simple instructions for working with CEF4Delphi (apply changes in the main application file - *.lpr):

1. Before launching the application, you must create CEFApplication:
Code: Pascal  [Select][+][-]
  1. GlobalCEFApp := TCefApplication.Create;

2. You can define where the CEF binary files needed for operation are located—if you do not specify the paths, the default location is Application.Location, i.e., the directory with the exe file. Properties to set:
Code: Pascal  [Select][+][-]
  1. GlobalCEFApp.FrameworkDirPath := 'C:\ProgramData\CEFDateien';
  2. GlobalCEFApp.ResourcesDirPath := GlobalCEFApp.FrameworkDirPath;
  3. GlobalCEFApp.LocalesDirPath := GlobalCEFApp.FrameworkDirPath + '\locales';

2a. You need to copy the required files to the specified location:, the contents of the Release and Resources folders. - you will extract them from the archive Windows 32-bit or Windows 64-bit- depends on the number of bits in your application.

3.  Start the CEF process:
Code: Pascal  [Select][+][-]
  1. GlobalCEFApp.StartMainProcess

4. at the end, you release CEFApp:
Code: Pascal  [Select][+][-]
  1. DestroyGlobalCEFApp

Important: you must include the unit uCEFApplication in the uses section.

An example file of the new project after the changes will look as follows:
Code: Pascal  [Select][+][-]
  1. program Project1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX}
  7.   cthreads,
  8.   {$ENDIF}
  9.   {$IFDEF HASAMIGA}
  10.   athreads,
  11.   {$ENDIF}
  12.   Interfaces, // this includes the LCL widgetset
  13.   Forms, Unit1
  14.   , uCEFApplication
  15.   { you can add units after this };
  16.  
  17. {$R *.res}
  18.  
  19. begin
  20.   GlobalCEFApp := TCefApplication.Create;
  21.   GlobalCEFApp.FrameworkDirPath := 'C:\ProgramData\CEFDateien';
  22.   GlobalCEFApp.ResourcesDirPath := GlobalCEFApp.FrameworkDirPath;
  23.   GlobalCEFApp.LocalesDirPath := GlobalCEFApp.FrameworkDirPath + '\locales';
  24.   if GlobalCEFApp.StartMainProcess then
  25.   begin
  26.     RequireDerivedFormResource:=True;
  27.     Application.Scaled:=True;
  28.     {$PUSH}{$WARN 5044 OFF}
  29.     Application.MainFormOnTaskbar:=True;
  30.     {$POP}
  31.     Application.Initialize;
  32.     Application.CreateForm(TForm1, Form1);
  33.     Application.Run;
  34.   end;
  35.   DestroyGlobalCEFApp;  //free CEF application
  36. end.
  37.  

Edit: fixed url's to cef binaries
« Last Edit: October 08, 2025, 06:53:16 am by paweld »
Best regards / Pozdrawiam
paweld

Nicole

  • Hero Member
  • *****
  • Posts: 1271
Re: CEF3 or 4 - the next step
« Reply #5 on: October 07, 2025, 06:39:39 pm »
My head feels a little bit like a horde of bees, where versions, OSs and files are humming.
I have all those links and downloaded so much, but somehow they things never fit together.

This demo I have is from here. I thought Pawel was so kind, so upload it?
But I cannot find any more in which thread.

And Linux?
I thought CEF would be Windows only (a huge disadvantaged IMHO).
Not?

Allow me to start with the working and not working.
Paweld linked a huge zip with much files in it to prove, that CEF work on Win 7.
Indeed. I could unzip it and a simplebrowser started. So working on Win 7 confirmed.

Then I wanted to try his demo and write my own app.
This started with a long list of error messages and ended up with only those two remaining I posted and could not solve. I cannot find where the need of Linux or so may be located.

Although I cannot find the posting any more in the forum, I can find the demo in my backup-folder for Lazarus demos. I attach it and it should be the posted one.


paule32

  • Hero Member
  • *****
  • Posts: 645
  • One in all. But, not all in one.
MS-IIS - Internet Information Server, Apache, PHP/HTML/CSS, MinGW-32/64 MSys2 GNU C/C++ 13 (-stdc++20), FPC 3.2.2
A Friend in need, is a Friend indeed.

Thaddy

  • Hero Member
  • *****
  • Posts: 18306
  • Here stood a man who saw the Elbe and jumped it.
Re: CEF3 or 4 - the next step
« Reply #7 on: October 08, 2025, 08:55:44 pm »
I thought CEF would be Windows only (a huge disadvantaged IMHO).
Not?

Of course not. It is the programming interface for Chromium. (So at least Chrome, Edge, basically all decent browsers apart from Firefox and super cross-platform. )
Don't use 3, forget about that, use 4.
( I am a bit bemused someone even mentioned 3: does not work anymore)
« Last Edit: October 08, 2025, 09:00:53 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Nicole

  • Hero Member
  • *****
  • Posts: 1271
Re: CEF3 or 4 - the next step
« Reply #8 on: October 09, 2025, 10:03:36 am »
This is what I try all the time. I fail since weeks.
I was not able to install CEF 4.

The demos do not run, they are not compatible, they do not start, the compiler refuses the CEF, the compiler refuses the demo, they run, but there are error-messages as a list filling the screen. The best were "only" 2 error messages, I posted but nobody seems able to solve.

I need CEF on a Win 7 VM with Lazararus 4.
And I have installed Crypt and CEF from the OPM of Lazarus.
I downloaded a huge bundle of files (about 100 MB), which Pawel was so kind to give me a link. This was the only one which started, - as an exe file. To make this a dpr, - I failed.
Pawel linked a demo, the one above. I led to the error messages I posted. It does not start for me.

Thaddy

  • Hero Member
  • *****
  • Posts: 18306
  • Here stood a man who saw the Elbe and jumped it.
Re: CEF3 or 4 - the next step
« Reply #9 on: October 09, 2025, 07:23:17 pm »
Hi
EGL -- Sounds like Enlightenment Graphics Library --  %)
...But I can very well be mistaken...  ;D
Regards Benny
https://www.khronos.org/egl/

I did some work on it for Raspberry Pi 1 and OpenVG. Must be here on the forum somewhere if you are interested. ~10 years
old.
It is super low-level. (page flipping on address and such things, no drawing primitives) It is barely an abstraction.
« Last Edit: October 09, 2025, 07:28:41 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

 

TinyPortal © 2005-2018