Sign in Join
Wiki copytemporary

CEF4Delphi/es: what changed

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

OldNewLine
11## Contents
22
33 * 1 Acerca de
44 * 2 Links
55 * 3 Installation
66 * 4 Usage
77 * 4.1 Quick Starters
88 * 4.2 Event properties
99 * 4.3 Linux
1010 * 4.4 macOS (Cocoa) - NSPrincipalClass
1111 * 4.4.1 Cocoa on Lazarus 2.0.12
1212
1313## Acerca de
1414
1515CEF4Delphi 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.
1616
1717En 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).
1818
1919Desde 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).
2020
2121CEF4Delphi está basado en [[fpCEF3]]
2222
2323## Links
2424
2525The 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>)
2626
2727Forum: <https://www.briskbard.com/forum/>
2828
2929The CEF documentation is at <https://magpcss.org/ceforum/apidocs3/>
3030
3131Forum: <https://magpcss.org/ceforum/>
3232
3333## Installation
3434
3535CEF4Delphi is available in the Online Package Manager.
3636
3737In order to get the full feature set, you may need to install from the "external repository".
3838
3939The git repository can be found here: <https://github.com/salvadordf/CEF4Delphi>
4040
4141The framework binaries can be found here: <https://cef-builds.spotifycdn.com/index.html>
4242
4343There version need to match the version expected by the CEF4Delphi package. See git commit log <https://github.com/salvadordf/CEF4Delphi/commits/master>
4444
4545The version check can be disabled for basic testing: "GlobalCEFApp.CheckCEFFiles := false;". However this should not be done for releases or more complex projects.
4646
4747## Usage
4848
4949The 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>)
5050
5151### Quick Starters
5252
5353The simplest way is to look at the following 2 demos:
5454
5555demos/Lazarus_any_OS/BrowserWindow
5656 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)
5757demos/Lazarus_any_OS/BrowserWindowEx
5858 A demo that shows how to dynamically create and close browsers in your application
5959
6060Make sure to read:
6161
6262 * the part of the documentation (link) on downloading and installing the "CEF binaries".
6363 * The README.txt in each demo-app's folder
6464
6565Before writing your own app, read the comments on top of uCEFBrowesWindow.pas
6666
6767Optionally explore the settings in each demo-app's GlobalCefApplication.pas
6868
6969### Event properties
7070
7171Many 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.
7272
7373Some events are executed in a different Process. They can not even share Global variables. See the DOM demos on how communication is done.
7474
7575You can check the CEF documentation for each event.
7676
7777### Linux
7878
7979On 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.
8080
8181This requires modifications to the project.lpr file.
8282
8383In 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)
8484
8585### macOS (Cocoa) - NSPrincipalClass
8686
8787On macOS the application [[macOS property list files|Info.plist]] file must be modified to set NSPrincipalClass to TCrCocoaApplication.
8888
8989There 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).
9090
9191Under Lazarus 2.1 (trunk) the NSPrincipalClass can be set in the "Project options".
9292
9393#### Cocoa on Lazarus 2.0.12
9494
9595In 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>).
9696
9797[Human readable Patch](<https://github.com/User4martin/lazarus/commit/cccd9460506e42d97fc726faba730ad1a65aa035>).
9898
9999---
100-*From the Free Pascal wiki, page "CEF4Delphi/es", as the Internet Archive kept it on 2025-05-16. 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).*
100+*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