This commit is contained in:
Gorochu
2026-07-15 19:37:38 -07:00
parent e06b85c897
commit 157b7220d9
8 changed files with 2671 additions and 0 deletions

View File

@ -46,6 +46,10 @@ extern "C" void websocket_run_groupchat_test(int rate, int duration);
#endif
#ifdef WITH_WEBVIEW
#include "webview.h"
#endif
//#include "socket_connection_test.cpp"
#include <kinc/graphics4/shader.h>
#include <kinc/graphics4/vertexbuffer.h>
@ -3010,6 +3014,50 @@ namespace {
SET_FUNCTION(runt, "windowY", runt_window_y);
SET_FUNCTION(runt, "language", runt_language);
#ifdef WITH_WEBVIEW
SET_FUNCTION(runt, "webviewCreate", runt_webview_create);
SET_FUNCTION(runt, "webviewLoadHTML", runt_webview_load_html);
SET_FUNCTION(runt, "webviewLoadURL", runt_webview_load_url);
SET_FUNCTION(runt, "webviewEvalJS", runt_webview_eval_js);
SET_FUNCTION(runt, "webviewShow", runt_webview_show);
SET_FUNCTION(runt, "webviewHide", runt_webview_hide);
SET_FUNCTION(runt, "webviewDestroy", runt_webview_destroy);
SET_FUNCTION(runt, "webviewResize", runt_webview_resize);
SET_FUNCTION(runt, "webviewMove", runt_webview_move);
SET_FUNCTION(runt, "webviewSetBounds", runt_webview_set_bounds);
SET_FUNCTION(runt, "webviewGetX", runt_webview_get_x);
SET_FUNCTION(runt, "webviewGetY", runt_webview_get_y);
SET_FUNCTION(runt, "webviewGetWidth", runt_webview_get_width);
SET_FUNCTION(runt, "webviewGetHeight", runt_webview_get_height);
SET_FUNCTION(runt, "webviewSetTransparent", runt_webview_set_transparent);
SET_FUNCTION(runt, "webviewSetClickThrough", runt_webview_set_click_through);
SET_FUNCTION(runt, "webviewSetTitle", runt_webview_set_title);
SET_FUNCTION(runt, "webviewSend", runt_webview_send);
SET_FUNCTION(runt, "webviewSetOnMessage", runt_webview_set_on_message);
SET_FUNCTION(runt, "webviewSetOnLoad", runt_webview_set_on_load);
SET_FUNCTION(runt, "webviewSetOnError", runt_webview_set_on_error);
SET_FUNCTION(runt, "webviewSetOnClose", runt_webview_set_on_close);
SET_FUNCTION(runt, "webviewCount", runt_webview_count);
SET_FUNCTION(runt, "webviewIsValid", runt_webview_is_valid);
SET_FUNCTION(runt, "webviewSetActiveDOM", runt_webview_set_active_dom);
SET_FUNCTION(runt, "webviewGetActiveDOM", runt_webview_get_active_dom);
SET_FUNCTION(runt, "webviewEvalJSAsync", runt_webview_eval_js_async);
SET_FUNCTION(runt, "webviewGoBack", runt_webview_go_back);
SET_FUNCTION(runt, "webviewGoForward", runt_webview_go_forward);
SET_FUNCTION(runt, "webviewReload", runt_webview_reload);
SET_FUNCTION(runt, "webviewCanGoBack", runt_webview_can_go_back);
SET_FUNCTION(runt, "webviewCanGoForward", runt_webview_can_go_forward);
SET_FUNCTION(runt, "webviewGetURL", runt_webview_get_url);
SET_FUNCTION(runt, "webviewGetPageTitle", runt_webview_get_page_title);
SET_FUNCTION(runt, "webviewMinimize", runt_webview_minimize);
SET_FUNCTION(runt, "webviewMaximize", runt_webview_maximize);
SET_FUNCTION(runt, "webviewRestore", runt_webview_restore);
SET_FUNCTION(runt, "webviewSetFullscreen", runt_webview_set_fullscreen);
SET_FUNCTION(runt, "webviewIsFullscreen", runt_webview_is_fullscreen);
SET_FUNCTION(runt, "webviewEnableDevTools", runt_webview_enable_devtools);
SET_FUNCTION(runt, "webviewSetContextMenu", runt_webview_set_context_menu);
#endif
Local<ObjectTemplate> global = ObjectTemplate::New(isolate);
global->Set(String::NewFromUtf8(isolate, "RunT").ToLocalChecked(), runt);
global->Set(String::NewFromUtf8(isolate, "runt").ToLocalChecked(), runt); // lowercase alias for JavaScript compatibility
@ -4072,6 +4120,7 @@ int kickstart(int argc, char **argv) {
// TODO: find and fix
while (update_func.IsEmpty()) {
kinc_internal_handle_messages();
handle_worker_messages(isolate, global_context);
EngineManager::AsyncEngine::instance().process_events();
MicrotasksScope::PerformCheckpoint(isolate);