A simple example of how to use the C API in the Chromium Embedded
Framework (CEF), originally created by
Czarek Tomczak.
The example creates a window, embeds a browser and loads the Google website.
It shows how to implement CEF structures with callbacks for handlers such as
cef_app_t, cef_client_t and cef_life_span_handler_t. The example primarily
uses dummy reference counting for simplicity, but cef_load_handler.h
and reference_counting.h also demonstrate how real reference counting
can be implemented. To better understand real reference counting see the
Using The CAPI
wiki page in the upstream CEF project.
Table of contents:
- Windows: see main_win.c
- Linux: see main_linux.c
- Mac: not available yet (Issue #15)
Tested configurations:
- Windows:
- Binary:
cef_binary_148.0.10+g7ee53f5+chromium-148.0.7778.218_windows64.tar.bz2 - Compilers: mingw-w64 gcc 12.4.0 and Visual Studio 2022 on Windows 11 64-bit
- Binary:
- Linux:
- Binary:
cef_binary_145.0.25+g265860d+chromium-145.0.7632.76_linux64.tar.bz2 - Compiler: gcc 11.4.0 on Ubuntu 22.04 64-bit
- Binary:
- Download "Standard Distribution" binaries from Spotify Automated Builds for the supported CEF version mentioned in the Compatibility section above: https://cef-builds.spotifycdn.com/index.html
- Put the downloaded
cef_binary_*.tar.bz2file into thethird_party/directory - On Linux run
make(example uses GTK+ 3) - On Windows run
build_msvc.batorbuild_gcc.batto build with MSVC or MinGW, respectively- 7zip will need to be installed, or you will need to extract cef manually
- The built application will appear in the
Releasedirectory at repo top level
If you would like to support general CEF C API development efforts by making a donation please click the Paypal Donate button: