mirror of
https://github.com/tauri-apps/web-view.git
synced 2026-02-04 10:21:17 +01:00
This adds webview as a submodule instead of including sources directly. New webview function are not yet implemented, the functionality stays the same.
29 lines
720 B
C
29 lines
720 B
C
#define WEBVIEW_IMPLEMENTATION
|
|
#include "webview.h"
|
|
|
|
void wrapper_webview_free(struct webview* w) {
|
|
free(w);
|
|
}
|
|
|
|
struct webview* wrapper_webview_new(const char* title, const char* url, int width, int height, int resizable, int debug, webview_external_invoke_cb_t external_invoke_cb, void* userdata) {
|
|
struct webview* w = (struct webview*)calloc(1, sizeof(*w));
|
|
w->width = width;
|
|
w->height = height;
|
|
w->title = title;
|
|
w->url = url;
|
|
w->resizable = resizable;
|
|
w->debug = debug;
|
|
w->external_invoke_cb = external_invoke_cb;
|
|
w->userdata = userdata;
|
|
if (webview_init(w) != 0) {
|
|
wrapper_webview_free(w);
|
|
return NULL;
|
|
}
|
|
return w;
|
|
}
|
|
|
|
void* wrapper_webview_get_userdata(struct webview* w) {
|
|
return w->userdata;
|
|
}
|
|
|