Sign in Join
Wiki copytemporary

CEF4Delphi/es: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-## Contents
2-
3- * 1 Acerca de
4- * 2 Links
5- * 3 Installation
6- * 4 Usage
7- * 4.1 Quick Starters
8- * 4.2 Event properties
9- * 4.3 Linux
10- * 4.4 macOS (Cocoa) - NSPrincipalClass
11- * 4.4.1 Cocoa on Lazarus 2.0.12
12-
131## Acerca de
142
153CEF4Delphi es un envoltorio, una interfaz, en Pascal para el "Chromium Embedded Framework". Este permite a Lazarus para embeber un navegador web basado en la maquinaria de Chromium.
164
175En estos momentos está soportado para aplicaciones creadas con Lazarus para Windows y Linux(GTK-2) con objetivo x86_64 (para i386 están pendientes las pruebas).
186
197Desde la versión 2.1 (trunk) de Lazarus hay soportr para Cocoa x86_64. (Cocoa no incluye toda la funcionalidad del modo OSR, pero en modo normal de ventanas todas las funciones están disponibles).
208
219CEF4Delphi está basado en [[fpCEF3]]
2210
2311## Links
2412
2513The CEF4Delphi documentation can be found at [https://www.briskbard.com/index.php?lang=en&pageid=cef](<https://www.briskbard.com/index.php?lang=en&pageid=cef>)
2614
2715Forum: <https://www.briskbard.com/forum/>
2816
2917The CEF documentation is at <https://magpcss.org/ceforum/apidocs3/>
3018
3119Forum: <https://magpcss.org/ceforum/>
3220
3321## Installation
3422
3523CEF4Delphi is available in the Online Package Manager.
3624
3725In order to get the full feature set, you may need to install from the "external repository".
3826
3927The git repository can be found here: <https://github.com/salvadordf/CEF4Delphi>
4028
4129The framework binaries can be found here: <https://cef-builds.spotifycdn.com/index.html>
4230
4331There version need to match the version expected by the CEF4Delphi package. See git commit log <https://github.com/salvadordf/CEF4Delphi/commits/master>
4432
4533The version check can be disabled for basic testing: "GlobalCEFApp.CheckCEFFiles := false;". However this should not be done for releases or more complex projects.
4634
4735## Usage
4836
4937The usage is described in the documentation at [https://www.briskbard.com/index.php?lang=en&pageid=cef](<https://www.briskbard.com/index.php?lang=en&pageid=cef>)
5038
5139### Quick Starters
5240
5341The simplest way is to look at the following 2 demos:
5442
55-demos/Lazarus_any_OS/BrowserWindow
56- A demo to show how to use a browser that will exist for the life-time of the application. (I.e. the browser is only closed, when the application exits)
57-demos/Lazarus_any_OS/BrowserWindowEx
58- A demo that shows how to dynamically create and close browsers in your application
43+**demos/Lazarus_any_OS/BrowserWindow**
44+
45+A demo to show how to use a browser that will exist for the life-time of the application. (I.e. the browser is only closed, when the application exits)
46+
47+**demos/Lazarus_any_OS/BrowserWindowEx**
48+
49+A demo that shows how to dynamically create and close browsers in your application
5950
6051Make sure to read:
6152
6253 * the part of the documentation (link) on downloading and installing the "CEF binaries".
6354 * The README.txt in each demo-app's folder
6455
6556Before writing your own app, read the comments on top of uCEFBrowesWindow.pas
6657
6758Optionally explore the settings in each demo-app's GlobalCefApplication.pas
6859
6960### Event properties
7061
7162Many events (OnSomeEvent), including many of those assignable from the Object-Inspector will be executed in threads created by CEF. Events in threads are not allowed to access any components (Forms, Button, entire LCL...), and also restricted in what calls they may make to the OS. For other data they may need CriticalSections or similar. See the linked documentation.
7263
7364Some events are executed in a different Process. They can not even share Global variables. See the DOM demos on how communication is done.
7465
7566You can check the CEF documentation for each event.
7667
7768### Linux
7869
7970On Linux CEF must be setup before the application creates any threads. Since gtk may create threads, CEF must be initialized before the LCL widgetset initializes gtk2.
8071
8172This requires modifications to the project.lpr file.
8273
8374In the demos, this is done by including a unit in the "uses" clause, before the "unit interfaces". In that unit is a "initialization" section, and that runs before the widgetset (if units are used in the correct order)
8475
8576### macOS (Cocoa) - NSPrincipalClass
8677
8778On macOS the application [[macOS property list files|Info.plist]] file must be modified to set NSPrincipalClass to TCrCocoaApplication.
8879
8980There are scripts provided to do that. The scripts also put the "Helper apps" in place. (Assuming you compile them first / See the README.txt files).
9081
9182Under Lazarus 2.1 (trunk) the NSPrincipalClass can be set in the "Project options".
9283
9384#### Cocoa on Lazarus 2.0.12
9485
9586In order to use CEF4Delphi with Cocoa x86_64 you must patch your Lazarus 2.0.12 version: [Patch](<https://github.com/User4martin/lazarus/commit/cccd9460506e42d97fc726faba730ad1a65aa035.diff>).
9687
9788[Human readable Patch](<https://github.com/User4martin/lazarus/commit/cccd9460506e42d97fc726faba730ad1a65aa035>).
9889
9990---
10091*From the Free Pascal wiki, page "CEF4Delphi/es", as the Internet Archive kept it on 2025-05-16, last changed on 2022-02-05. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history