gpui-component/crates/wef/cpp/load_library.cpp
Sunli b70b229370
wef: Added a new WebView component named "Wef" based on CEF. (#877)
Wef is a Rust library for embedding WebView functionality using Chromium
Embedded Framework (CEF3) with offscreen rendering support.
2025-06-17 18:57:44 +08:00

27 lines
No EOL
611 B
C++

#include "include/wrapper/cef_library_loader.h"
extern "C" {
void* wef_load_library(bool helper) {
CefScopedLibraryLoader* library_loader = new CefScopedLibraryLoader();
if (!helper) {
if (!library_loader->LoadInMain()) {
delete library_loader;
return nullptr;
}
} else {
if (!library_loader->LoadInHelper()) {
delete library_loader;
return nullptr;
}
}
return library_loader;
}
void wef_unload_library(void* loader) {
CefScopedLibraryLoader* library_loader =
static_cast<CefScopedLibraryLoader*>(loader);
delete library_loader;
}
} // extern "C"