/// Window disconnection event.
@@ -68,6 +68,27 @@ public enum webui_events
WEBUI_EVENT_CALLBACK,
};
+ ///
+ /// WebUI configuration.
+ ///
+ public enum webui_config
+ {
+ ///
+ /// Control if `webui_show()`, `webui_show_browser()` and
+ /// `webui_show_wv()` should wait for the window to connect
+ /// before returns or not. Default: True.
+ ///
+ show_wait_connection = 0,
+ ///
+ /// Control if WebUI should block and process the UI events
+ /// one a time in a single thread `True`, or process every
+ /// event in a new non-blocking thread `False`. This updates
+ /// all windows. You can use `webui_set_event_blocking()` for
+ /// a specific single window update. Default: False.
+ ///
+ ui_event_blocking,
+ }
+
///
/// Structure with event information
///
diff --git a/WebUI4CSharp/WebUIWindow.cs b/WebUI4CSharp/WebUIWindow.cs
index c8411a2..76a6884 100644
--- a/WebUI4CSharp/WebUIWindow.cs
+++ b/WebUI4CSharp/WebUIWindow.cs
@@ -132,6 +132,25 @@ public UIntPtr ChildProcessId
}
}
+ ///
+ /// Get the recommended web browser ID to use. If you are already using one,
+ /// this function will return the same ID.
+ ///
+ public webui_browser BestBrowser
+ {
+ get
+ {
+ if (Initialized)
+ {
+ return (webui_browser)WebUILibFunctions.webui_get_best_browser(_id);
+ }
+ else
+ {
+ return webui_browser.NoBrowser;
+ }
+ }
+ }
+
///
/// Event triggered after binding a webui event.
///
@@ -234,11 +253,22 @@ public bool Show(string content)
/// The HTML, URL, Or a local file.
/// The web browser to be used.
/// Returns True if showing the window is successed.
- public bool ShowBrowser(string content, webui_browsers browser)
+ public bool ShowBrowser(string content, webui_browser browser)
{
return Initialized && WebUILibFunctions.webui_show_browser(_id, content, (UIntPtr)browser);
}
+ ///
+ /// Show a WebView window using embedded HTML, or a file. If the window is already
+ /// open, it will be refreshed. Note: Win32 need `WebView2Loader.dll`.
+ ///
+ /// The HTML, URL, Or a local file.
+ /// Returns True if showing the window is successed.
+ public bool ShowWV(string content)
+ {
+ return Initialized && WebUILibFunctions.webui_show_wv(_id, content);
+ }
+
///
/// Bind a specific html element click event with a callback function. Empty element means all events.
///
@@ -476,7 +506,7 @@ public void SetProfile(string name, string path)
}
///
- /// Set the web browser proxy_server to use. Need to be called before 'webui_show()'.
+ /// Set the web browser proxy server to use. Need to be called before `webui_show()`.
///
/// The web browser proxy_server. For example 'http://127.0.0.1:8888'
public void SetProxy(string proxy_server)
@@ -523,7 +553,7 @@ public void DeleteProfile()
}
///
- /// Set a custom web-server network port to be used by WebUI.
+ /// Set a custom web-server/websocket network port to be used by WebUI.
/// This can be useful to determine the HTTP link of `webui.js` in case
/// you are trying to use WebUI with an external web-server like NGNIX
///
@@ -534,6 +564,21 @@ public bool SetPort(UIntPtr port)
return Initialized && WebUILibFunctions.webui_set_port(_id, port);
}
+ ///
+ /// Control if UI events comming from this window should be processed
+ /// one a time in a single blocking thread `True`, or process every event in
+ /// a new non-blocking thread `False`. This update single window. You can use
+ /// WebUI.SetConfig(ui_event_blocking, ...)` to update all windows.
+ ///
+ /// The blocking status `true` or `false`.
+ public void SetEventBlocking(bool status)
+ {
+ if (Initialized)
+ {
+ WebUILibFunctions.webui_set_event_blocking(_id, status);
+ }
+ }
+
///
/// Run JavaScript without waiting for the response.
///
@@ -582,8 +627,8 @@ public bool Script(string script_, UIntPtr timeout, out string response, UIntPtr
///
/// Chose between Deno and Nodejs as runtime for .js and .ts files.
///
- /// Deno or Nodejs.
- public void SetRuntime(webui_runtimes runtime)
+ /// Deno, Nodejs or None.
+ public void SetRuntime(webui_runtime runtime)
{
if (Initialized)
{
diff --git a/WebUI_binaries/32bits/webui-2.dll b/WebUI_binaries/32bits/webui-2.dll
index 13eeac8..f3e5d9a 100644
Binary files a/WebUI_binaries/32bits/webui-2.dll and b/WebUI_binaries/32bits/webui-2.dll differ
diff --git a/WebUI_binaries/32bits/webui-2_debug.dll b/WebUI_binaries/32bits/webui-2_debug.dll
index a2139bb..09935da 100644
Binary files a/WebUI_binaries/32bits/webui-2_debug.dll and b/WebUI_binaries/32bits/webui-2_debug.dll differ
diff --git a/WebUI_binaries/64bits/webui-2.dll b/WebUI_binaries/64bits/webui-2.dll
index f5cfc58..ffd9a4c 100644
Binary files a/WebUI_binaries/64bits/webui-2.dll and b/WebUI_binaries/64bits/webui-2.dll differ
diff --git a/WebUI_binaries/64bits/webui-2_debug.dll b/WebUI_binaries/64bits/webui-2_debug.dll
index c8ef368..30df621 100644
Binary files a/WebUI_binaries/64bits/webui-2_debug.dll and b/WebUI_binaries/64bits/webui-2_debug.dll differ
diff --git a/assets/serve_a_folder/index.html b/assets/serve_a_folder/index.html
index 4b16b23..54d406b 100644
--- a/assets/serve_a_folder/index.html
+++ b/assets/serve_a_folder/index.html
@@ -79,12 +79,9 @@
Unicode Test:
- مرحبًا
-
- 你好
-
- こんにちは
-
+ مرحبًا
+ 你好
+ こんにちは