diff --git a/Runtime/Bindings/FFI/webview/webview_ffi.cpp b/Runtime/Bindings/FFI/webview/webview_ffi.cpp index 332f0165..070fb1e8 100644 --- a/Runtime/Bindings/FFI/webview/webview_ffi.cpp +++ b/Runtime/Bindings/FFI/webview/webview_ffi.cpp @@ -34,86 +34,10 @@ namespace webview_ffi { return static_cast(w)->step(blocking); } - webview_t webview_create(bool debug, void* wnd) { - auto w = new WebviewBrowserEngine(debug, wnd); - if(unwrapResult(w->window())) { - delete w; - return nullptr; - } - return w; - } - - webview_error_t webview_destroy(webview_t w) { - delete static_cast(w); - } - void webview_toggle_fullscreen(webview_t w) { static_cast(w)->toggleFullScreen(); } - webview_error_t webview_run(webview_t w) { - static_cast(w)->run(); - } - - webview_error_t webview_terminate(webview_t w) { - static_cast(w)->terminate(); - } - - void webview_dispatch(webview_t w, void (*fn)(webview_t, void*), - void* arg) { - static_cast(w)->dispatch([=]() { fn(w, arg); }); - } - - void* webview_get_window(webview_t w) { - return unwrapResult(static_cast(w)->window()); - } - - webview_error_t webview_set_title(webview_t w, const char* title) { - static_cast(w)->set_title(title); - } - - webview_error_t webview_set_size(webview_t w, int width, int height, - webview_hint_t hints) { - static_cast(w)->set_size(width, height, hints); - } - - webview_error_t webview_navigate(webview_t w, const char* url) { - static_cast(w)->navigate(url); - } - - webview_error_t webview_set_html(webview_t w, const char* html) { - static_cast(w)->set_html(html); - } - - webview_error_t webview_init(webview_t w, const char* js) { - static_cast(w)->init(js); - } - - webview_error_t webview_eval(webview_t w, const char* js) { - static_cast(w)->eval(js); - } - - webview_error_t webview_bind(webview_t w, const char* name, - void (*fn)(const char* seq, const char* req, - void* arg), - void* arg) { - static_cast(w)->bind( - name, - [=](const std::string& seq, const std::string& req, void* arg) { - fn(seq.c_str(), req.c_str(), arg); - }, - arg); - } - - webview_error_t webview_unbind(webview_t w, const char* name) { - static_cast(w)->unbind(name); - } - - webview_error_t webview_return(webview_t w, const char* seq, int status, - const char* result) { - static_cast(w)->resolve(seq, status, result); - } - bool webview_set_icon(webview_t w, const char* file_path) { return static_cast(w)->setAppIcon(file_path); }