From 3afe364ea59f9a464c6689e7ffba805d1d36c47c Mon Sep 17 00:00:00 2001 From: YesDrX <68913671+YesDrX@users.noreply.github.com> Date: Mon, 8 Dec 2025 18:00:42 -0500 Subject: [PATCH 1/9] Add '-y' flag to nimble install command --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 269ae80..84153bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,7 +45,7 @@ jobs: - name: Generate bindings run: | - nimble install c2nim + nimble install c2nim -y nim scripts/generate_bindings.nims - name: Compile examples From b683d2328c487a9cd525b2a43b4d2c10a4b252fc Mon Sep 17 00:00:00 2001 From: YesDrX <68913671+YesDrX@users.noreply.github.com> Date: Mon, 8 Dec 2025 18:04:55 -0500 Subject: [PATCH 2/9] Upgrade Nim setup action to version 2 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84153bd..f66e940 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Nim - uses: jiro4989/setup-nim-action@v1 + uses: jiro4989/setup-nim-action@v2 with: nim-version: ${{ matrix.nim }} repo-token: ${{ secrets.GITHUB_TOKEN }} From 0193337061d95bc1050d3fdf4926694bb8b58535 Mon Sep 17 00:00:00 2001 From: YesDrX <68913671+YesDrX@users.noreply.github.com> Date: Mon, 8 Dec 2025 18:12:21 -0500 Subject: [PATCH 3/9] Add force flag to nim compile commands --- .github/workflows/test.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f66e940..7dfed28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,13 +50,12 @@ jobs: - name: Compile examples run: | - nim c examples/minimal.nim - nim c examples/hello_world.nim - nim c examples/hello_world_c.nim - nim c examples/call_nim_from_js.nim - nim c examples/call_js_from_nim.nim - nim c examples/public_network_access.nim - - nim c examples/serve_folder/serve_folder.nim - nim c examples/qxexample/qxexample.nim - # nim c examples/text_editor/src/text_editor.nim # osfiles/dialog not available in macos + nim c -f examples/minimal.nim + nim c -f examples/hello_world.nim + nim c -f examples/hello_world_c.nim + nim c -f examples/call_nim_from_js.nim + nim c -f examples/call_js_from_nim.nim + nim c -f examples/public_network_access.nim + nim c -f examples/serve_folder/serve_folder.nim + nim c -f examples/qxexample/qxexample.nim + # nim c -f examples/text_editor/src/text_editor.nim # osfiles/dialog not available in macos From 40028b6398fdbf193ecd5e2b74c712d25f80e26c Mon Sep 17 00:00:00 2001 From: Yes DrX Date: Mon, 8 Dec 2025 18:28:45 -0500 Subject: [PATCH 4/9] change webui to nightly; fix workflows --- .github/workflows/test.yml | 4 +- .gitignore | 2 + examples/public_network_access.nim | 6 +- webui.nimble | 2 +- webui/bindings.nim | 131 ++++++++++++++++++++++++++++- webui/webui | 2 +- 6 files changed, 136 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 269ae80..f66e940 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Nim - uses: jiro4989/setup-nim-action@v1 + uses: jiro4989/setup-nim-action@v2 with: nim-version: ${{ matrix.nim }} repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -45,7 +45,7 @@ jobs: - name: Generate bindings run: | - nimble install c2nim + nimble install c2nim -y nim scripts/generate_bindings.nims - name: Compile examples diff --git a/.gitignore b/.gitignore index bac62a8..0512a96 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ *.exe *.so *.a +.vscode +.vscode/* \ No newline at end of file diff --git a/examples/public_network_access.nim b/examples/public_network_access.nim index c99de63..810918c 100644 --- a/examples/public_network_access.nim +++ b/examples/public_network_access.nim @@ -76,12 +76,12 @@ proc main = # Public Window public_window.public = true # Make URL accessible from public networks public_window.bind("") do (e: Event): # Bind all events - if e.eventType == weConnected: + if e.eventType == WebuiEvent.weConnected: private_window.run("document.getElementById('Logs').value += 'New connection.\\n';") - elif e.eventType == weDisconnected: + elif e.eventType == WebuiEvent.weDisconnected: private_window.run("document.getElementById('Logs').value += 'Disconnected.\\n';") - public_window.show(publicHtml, wbNoBrowser) # Set public window HTML + public_window.show(publicHtml, WebuiBrowser.wbNoBrowser) # Set public window HTML let public_win_url = public_window.url # Get URL of public window # Main Private Window diff --git a/webui.nimble b/webui.nimble index 02c39bd..052e1ee 100644 --- a/webui.nimble +++ b/webui.nimble @@ -1,6 +1,6 @@ # Package -version = "2.5.0.1" +version = "2.5.0.2" author = "Jasmine" description = "Wrapper for WebUI" license = "MIT" diff --git a/webui/bindings.nim b/webui/bindings.nim index e3fe983..94e4096 100644 --- a/webui/bindings.nim +++ b/webui/bindings.nim @@ -5,7 +5,7 @@ include ./bindings_prefix.nim const - WEBUI_VERSION* = "2.5.0-beta.3" ## + WEBUI_VERSION* = "2.5.0-beta.4" ## ## WebUI Library ## https://webui.me ## https://github.com/webui-dev/webui @@ -145,6 +145,11 @@ type cookies*: cstring ## Client's full cookies + WebuiLoggerLevel* {.renameEnumFields.} = enum + WEBUI_LOGGER_LEVEL_DEBUG = 0, ## 0. All logs with all details + WEBUI_LOGGER_LEVEL_INFO, ## 1. Only general logs + WEBUI_LOGGER_LEVEL_ERROR ## 2. Only fatal error logs + proc new_window*(): csize_t {.webui, importc: "webui_new_window".} ## -- Definitions --------------------- @@ -335,6 +340,17 @@ proc set_high_contrast*(window: csize_t; status: bool) {. ## ## @example webui_set_high_contrast(myWindow, true); ## +proc set_resizable*(window: csize_t; status: bool) {. + webui, importc: "webui_set_resizable".} + ## + ## @brief Sets whether the window frame is resizable or fixed. + ## Works only on WebView window. + ## + ## @param window The window number + ## @param status True or False + ## + ## @example webui_set_resizable(myWindow, true); + ## proc is_high_contrast*(): bool {.webui, importc: "webui_is_high_contrast".} ## ## @brief Get OS high contrast preference. @@ -366,6 +382,22 @@ proc close*(window: csize_t) {.webui, importc: "webui_close".} ## ## @example webui_close(myWindow); ## +proc minimize*(window: csize_t) {.webui, importc: "webui_minimize".} + ## + ## @brief Minimize a WebView window. + ## + ## @param window The window number + ## + ## @example webui_minimize(myWindow); + ## +proc maximize*(window: csize_t) {.webui, importc: "webui_maximize".} + ## + ## @brief Maximize a WebView window. + ## + ## @param window The window number + ## + ## @example webui_maximize(myWindow); + ## proc close_client*(e: ptr Event) {.webui, importc: "webui_close_client".} ## ## @brief Close a specific client. @@ -398,6 +430,14 @@ proc set_root_folder*(window: csize_t; path: cstring): bool {. ## ## @example webui_set_root_folder(myWindow, "/home/Foo/Bar/"); ## +proc set_browser_folder*(path: cstring) {.webui, importc: "webui_set_browser_folder".} + ## + ## @brief Set custom browser folder path. + ## + ## @param path The browser folder path + ## + ## @example webui_set_browser_folder("/home/Foo/Bar/"); + ## proc set_default_root_folder*(path: cstring): bool {. webui, importc: "webui_set_default_root_folder".} ## @@ -408,6 +448,20 @@ proc set_default_root_folder*(path: cstring): bool {. ## ## @example webui_set_default_root_folder("/home/Foo/Bar/"); ## +proc set_close_handler_wv*(window: csize_t; + close_handler: proc (window: csize_t): bool {.webui.}) {. + webui, importc: "webui_set_close_handler_wv".} + ## + ## @brief Set a callback to catch the close event of the WebView window. + ## Must return `false` to prevent the close event, `true` otherwise. + ## + ## @example + ## bool myCloseEvent(size_t window) { + ## // Prevent WebView window close event + ## return false; + ## } + ## webui_set_close_handler(myWindow, myCloseEvent); + ## proc set_file_handler*(window: csize_t; handler: proc (filename: cstring; length: ptr cint): pointer {.webui.}) {.webui, importc: "webui_set_file_handler".} ## @@ -591,6 +645,15 @@ proc set_position*(window: csize_t; x: cuint; y: cuint) {. ## ## @example webui_set_position(myWindow, 100, 100); ## +proc set_center*(window: csize_t) {.webui, importc: "webui_set_center".} + ## + ## @brief Centers the window on the screen. Works better with + ## WebView. Call this function before `webui_show()` for better results. + ## + ## @param window The window number + ## + ## @example webui_set_center(myWindow); + ## proc set_profile*(window: csize_t; name: cstring; path: cstring) {. webui, importc: "webui_set_profile".} ## @@ -695,8 +758,7 @@ proc delete_profile*(window: csize_t) {.webui, importc: "webui_delete_profile".} proc get_parent_process_id*(window: csize_t): csize_t {. webui, importc: "webui_get_parent_process_id".} ## - ## @brief Get the ID of the parent process (The web browser may re-create - ## another new process). + ## @brief Get the parent process ID, which refers to the current backend application process. ## ## @param window The window number ## @@ -707,7 +769,10 @@ proc get_parent_process_id*(window: csize_t): csize_t {. proc get_child_process_id*(window: csize_t): csize_t {. webui, importc: "webui_get_child_process_id".} ## - ## @brief Get the ID of the last child process. + ## @brief Get the child process ID created by the parent, which refers to the web browser window. + ## + ## Note: In WebView mode, this will return the parent process ID because the backend and the + ## WebView window run in the same process. ## ## @param window The window number ## @@ -727,6 +792,19 @@ proc win32_get_hwnd*(window: csize_t): pointer {. ## ## @example HWND hwnd = webui_win32_get_hwnd(myWindow); ## +proc get_hwnd*(window: csize_t): pointer {.webui, importc: "webui_get_hwnd".} + ## + ## @brief Get window `HWND`. More reliable with WebView + ## than web browser window, as browser PIDs may change on launch. + ## + ## @param window The window number + ## + ## @return Returns the window `hwnd` in Win32, `GtkWindow` in Linux. + ## + ## @example + ## HWND hwnd = webui_get_hwnd(myWindow); // Win32 (Work with WebView and web browser) + ## GtkWindow* window = webui_get_hwnd(myWindow); // Linux (Work with WebView only) + ## proc get_port*(window: csize_t): csize_t {.webui, importc: "webui_get_port".} ## ## @brief Get the network port of a running window. @@ -759,6 +837,17 @@ proc get_free_port*(): csize_t {.webui, importc: "webui_get_free_port".} ## ## @example size_t port = webui_get_free_port(); ## +proc set_logger*(`func`: proc (level: csize_t; log: cstring; user_data: pointer) {.webui.}; + user_data: pointer) {.webui, importc: "webui_set_logger".} + ## + ## @brief Set a custom logger function. + ## + ## @example + ## void myLogger(size_t level, const char* log, void* user_data) { + ## printf("myLogger (%d): %s", level, log); + ## } + ## webui_set_logger(myLogger, NULL); + ## proc set_config*(option: WebuiConfig; status: bool) {. webui, importc: "webui_set_config".} ## @@ -782,6 +871,26 @@ proc set_event_blocking*(window: csize_t; status: bool) {. ## ## @example webui_set_event_blocking(myWindow, true); ## +proc set_frameless*(window: csize_t; status: bool) {. + webui, importc: "webui_set_frameless".} + ## + ## @brief Make a WebView window frameless. + ## + ## @param window The window number + ## @param status The frameless status `true` or `false` + ## + ## @example webui_set_frameless(myWindow, true); + ## +proc set_transparent*(window: csize_t; status: bool) {. + webui, importc: "webui_set_transparent".} + ## + ## @brief Make a WebView window transparent. + ## + ## @param window The window number + ## @param status The transparency status `true` or `false` + ## + ## @example webui_set_transparent(myWindow, true); + ## proc get_mime_type*(file: cstring): cstring {.webui, importc: "webui_get_mime_type".} ## ## @brief Get the HTTP mime type of a file. @@ -1024,6 +1133,20 @@ proc return_bool*(e: ptr Event; b: bool) {.webui, importc: "webui_return_bool".} ## ## @example webui_return_bool(e, true); ## +proc get_last_error_number*(): csize_t {. + webui, importc: "webui_get_last_error_number".} + ## + ## @brief Get the last WebUI error code. + ## + ## @example int error_num = webui_get_last_error_number(); + ## +proc get_last_error_message*(): cstring {. + webui, importc: "webui_get_last_error_message".} + ## + ## @brief Get the last WebUI error message. + ## + ## @example const char* error_msg = webui_get_last_error_message(); + ## proc interface_bind*(window: csize_t; element: cstring; `func`: proc ( a1: csize_t; a2: csize_t; a3: cstring; a4: csize_t; a5: csize_t) {.webui.}): csize_t {. webui, importc: "webui_interface_bind".} diff --git a/webui/webui b/webui/webui index fd716dd..e1018c5 160000 --- a/webui/webui +++ b/webui/webui @@ -1 +1 @@ -Subproject commit fd716ddcac980eee9f8f0c6fb6a94a240343fad0 +Subproject commit e1018c5d8c251fad9fa8fc2f9d2d50af06bd2fed From bab97d8c2fd93f716730ad4b569abe13559a7640 Mon Sep 17 00:00:00 2001 From: Yes DrX Date: Mon, 8 Dec 2025 18:36:29 -0500 Subject: [PATCH 5/9] fix workflows --- examples/custom_web_server/main.nim | 8 ++++---- examples/serve_folder/serve_folder.nim | 8 ++++---- examples/web_app_multi_client/main.nim | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/custom_web_server/main.nim b/examples/custom_web_server/main.nim index 0810ee8..de5d2e0 100644 --- a/examples/custom_web_server/main.nim +++ b/examples/custom_web_server/main.nim @@ -11,13 +11,13 @@ proc main = # there is an event case e.eventType - of weConnected: + of WebuiEvent.weConnected: echo "Connected" - of weDisconnected: + of WebuiEvent.weDisconnected: echo "Disconnected" - of weMouseClick: + of WebuiEvent.weMouseClick: echo "Click" - of weNavigation: + of WebuiEvent.weNavigation: let url = e.getString() echo "Starting navigation to: ", url diff --git a/examples/serve_folder/serve_folder.nim b/examples/serve_folder/serve_folder.nim index aedb406..9a74bca 100644 --- a/examples/serve_folder/serve_folder.nim +++ b/examples/serve_folder/serve_folder.nim @@ -40,13 +40,13 @@ proc main = # there is an event case e.eventType: - of weConnected: + of WebuiEvent.weConnected: echo "Connected" - of weDisconnected: + of WebuiEvent.weDisconnected: echo "Disconnected" - of weMouseClick: + of WebuiEvent.weMouseClick: echo "Click" - of weNavigation: + of WebuiEvent.weNavigation: echo "Starting navigation to: ", e.getString() else: discard diff --git a/examples/web_app_multi_client/main.nim b/examples/web_app_multi_client/main.nim index 6e1d6c6..d6da556 100644 --- a/examples/web_app_multi_client/main.nim +++ b/examples/web_app_multi_client/main.nim @@ -35,12 +35,12 @@ proc events(e: Event) = let connectionId = e.connectionId case e.eventType - of weConnected: # New connection + of WebuiEvent.weConnected: # New connection if users_count < (client_id + 1): # +1 because it starts from 0 users_count = client_id + 1 inc tabCount - of weDisconnected: # Disconnection + of WebuiEvent.weDisconnected: # Disconnection if tab_count > 0: dec tab_count else: @@ -73,7 +73,7 @@ proc events(e: Event) = proc main() = # Allow multi-user connection and cookies - setConfig({wcMultiClient, wcUseCookies}, true) + setConfig({WebuiConfig.wcMultiClient, WebuiConfig.wcUseCookies}, true) # Create new window let window = newWindow() From 28a2485ddd442eaba2d6706cb382a8d9aa8947d9 Mon Sep 17 00:00:00 2001 From: Yes DrX Date: Mon, 8 Dec 2025 18:39:12 -0500 Subject: [PATCH 6/9] fix workflows --- examples/serve_folder/serve_folder.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/serve_folder/serve_folder.nim b/examples/serve_folder/serve_folder.nim index 9a74bca..347bae3 100644 --- a/examples/serve_folder/serve_folder.nim +++ b/examples/serve_folder/serve_folder.nim @@ -84,7 +84,7 @@ proc main = window2.bind("Exit", exitApp) # Make Deno as the `.ts` and `.js` interpreter - window.runtime = wrDeno + window.runtime = WebuiRuntime.wrDeno # Set root folder to current directory window.rootFolder = currentSourcePath().parentDir() From 9efb6660f4756c34768064f4fb91f686b79947e7 Mon Sep 17 00:00:00 2001 From: Yes DrX Date: Mon, 8 Dec 2025 18:41:55 -0500 Subject: [PATCH 7/9] fix workflows --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f66e940..84153bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Nim - uses: jiro4989/setup-nim-action@v2 + uses: jiro4989/setup-nim-action@v1 with: nim-version: ${{ matrix.nim }} repo-token: ${{ secrets.GITHUB_TOKEN }} From 83f505f77138f5efed4302cabcbb650222413f9b Mon Sep 17 00:00:00 2001 From: Yes DrX Date: Mon, 8 Dec 2025 18:43:28 -0500 Subject: [PATCH 8/9] fix workflows --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84153bd..f66e940 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Nim - uses: jiro4989/setup-nim-action@v1 + uses: jiro4989/setup-nim-action@v2 with: nim-version: ${{ matrix.nim }} repo-token: ${{ secrets.GITHUB_TOKEN }} From 31503cb6a8ca799a6c4ddaff884736ca3d50ae1f Mon Sep 17 00:00:00 2001 From: Yes DrX Date: Mon, 8 Dec 2025 18:47:30 -0500 Subject: [PATCH 9/9] fix workflows --- webui/bindings.nim | 131 ++------------------------------------------- webui/webui | 2 +- 2 files changed, 5 insertions(+), 128 deletions(-) diff --git a/webui/bindings.nim b/webui/bindings.nim index 94e4096..e3fe983 100644 --- a/webui/bindings.nim +++ b/webui/bindings.nim @@ -5,7 +5,7 @@ include ./bindings_prefix.nim const - WEBUI_VERSION* = "2.5.0-beta.4" ## + WEBUI_VERSION* = "2.5.0-beta.3" ## ## WebUI Library ## https://webui.me ## https://github.com/webui-dev/webui @@ -145,11 +145,6 @@ type cookies*: cstring ## Client's full cookies - WebuiLoggerLevel* {.renameEnumFields.} = enum - WEBUI_LOGGER_LEVEL_DEBUG = 0, ## 0. All logs with all details - WEBUI_LOGGER_LEVEL_INFO, ## 1. Only general logs - WEBUI_LOGGER_LEVEL_ERROR ## 2. Only fatal error logs - proc new_window*(): csize_t {.webui, importc: "webui_new_window".} ## -- Definitions --------------------- @@ -340,17 +335,6 @@ proc set_high_contrast*(window: csize_t; status: bool) {. ## ## @example webui_set_high_contrast(myWindow, true); ## -proc set_resizable*(window: csize_t; status: bool) {. - webui, importc: "webui_set_resizable".} - ## - ## @brief Sets whether the window frame is resizable or fixed. - ## Works only on WebView window. - ## - ## @param window The window number - ## @param status True or False - ## - ## @example webui_set_resizable(myWindow, true); - ## proc is_high_contrast*(): bool {.webui, importc: "webui_is_high_contrast".} ## ## @brief Get OS high contrast preference. @@ -382,22 +366,6 @@ proc close*(window: csize_t) {.webui, importc: "webui_close".} ## ## @example webui_close(myWindow); ## -proc minimize*(window: csize_t) {.webui, importc: "webui_minimize".} - ## - ## @brief Minimize a WebView window. - ## - ## @param window The window number - ## - ## @example webui_minimize(myWindow); - ## -proc maximize*(window: csize_t) {.webui, importc: "webui_maximize".} - ## - ## @brief Maximize a WebView window. - ## - ## @param window The window number - ## - ## @example webui_maximize(myWindow); - ## proc close_client*(e: ptr Event) {.webui, importc: "webui_close_client".} ## ## @brief Close a specific client. @@ -430,14 +398,6 @@ proc set_root_folder*(window: csize_t; path: cstring): bool {. ## ## @example webui_set_root_folder(myWindow, "/home/Foo/Bar/"); ## -proc set_browser_folder*(path: cstring) {.webui, importc: "webui_set_browser_folder".} - ## - ## @brief Set custom browser folder path. - ## - ## @param path The browser folder path - ## - ## @example webui_set_browser_folder("/home/Foo/Bar/"); - ## proc set_default_root_folder*(path: cstring): bool {. webui, importc: "webui_set_default_root_folder".} ## @@ -448,20 +408,6 @@ proc set_default_root_folder*(path: cstring): bool {. ## ## @example webui_set_default_root_folder("/home/Foo/Bar/"); ## -proc set_close_handler_wv*(window: csize_t; - close_handler: proc (window: csize_t): bool {.webui.}) {. - webui, importc: "webui_set_close_handler_wv".} - ## - ## @brief Set a callback to catch the close event of the WebView window. - ## Must return `false` to prevent the close event, `true` otherwise. - ## - ## @example - ## bool myCloseEvent(size_t window) { - ## // Prevent WebView window close event - ## return false; - ## } - ## webui_set_close_handler(myWindow, myCloseEvent); - ## proc set_file_handler*(window: csize_t; handler: proc (filename: cstring; length: ptr cint): pointer {.webui.}) {.webui, importc: "webui_set_file_handler".} ## @@ -645,15 +591,6 @@ proc set_position*(window: csize_t; x: cuint; y: cuint) {. ## ## @example webui_set_position(myWindow, 100, 100); ## -proc set_center*(window: csize_t) {.webui, importc: "webui_set_center".} - ## - ## @brief Centers the window on the screen. Works better with - ## WebView. Call this function before `webui_show()` for better results. - ## - ## @param window The window number - ## - ## @example webui_set_center(myWindow); - ## proc set_profile*(window: csize_t; name: cstring; path: cstring) {. webui, importc: "webui_set_profile".} ## @@ -758,7 +695,8 @@ proc delete_profile*(window: csize_t) {.webui, importc: "webui_delete_profile".} proc get_parent_process_id*(window: csize_t): csize_t {. webui, importc: "webui_get_parent_process_id".} ## - ## @brief Get the parent process ID, which refers to the current backend application process. + ## @brief Get the ID of the parent process (The web browser may re-create + ## another new process). ## ## @param window The window number ## @@ -769,10 +707,7 @@ proc get_parent_process_id*(window: csize_t): csize_t {. proc get_child_process_id*(window: csize_t): csize_t {. webui, importc: "webui_get_child_process_id".} ## - ## @brief Get the child process ID created by the parent, which refers to the web browser window. - ## - ## Note: In WebView mode, this will return the parent process ID because the backend and the - ## WebView window run in the same process. + ## @brief Get the ID of the last child process. ## ## @param window The window number ## @@ -792,19 +727,6 @@ proc win32_get_hwnd*(window: csize_t): pointer {. ## ## @example HWND hwnd = webui_win32_get_hwnd(myWindow); ## -proc get_hwnd*(window: csize_t): pointer {.webui, importc: "webui_get_hwnd".} - ## - ## @brief Get window `HWND`. More reliable with WebView - ## than web browser window, as browser PIDs may change on launch. - ## - ## @param window The window number - ## - ## @return Returns the window `hwnd` in Win32, `GtkWindow` in Linux. - ## - ## @example - ## HWND hwnd = webui_get_hwnd(myWindow); // Win32 (Work with WebView and web browser) - ## GtkWindow* window = webui_get_hwnd(myWindow); // Linux (Work with WebView only) - ## proc get_port*(window: csize_t): csize_t {.webui, importc: "webui_get_port".} ## ## @brief Get the network port of a running window. @@ -837,17 +759,6 @@ proc get_free_port*(): csize_t {.webui, importc: "webui_get_free_port".} ## ## @example size_t port = webui_get_free_port(); ## -proc set_logger*(`func`: proc (level: csize_t; log: cstring; user_data: pointer) {.webui.}; - user_data: pointer) {.webui, importc: "webui_set_logger".} - ## - ## @brief Set a custom logger function. - ## - ## @example - ## void myLogger(size_t level, const char* log, void* user_data) { - ## printf("myLogger (%d): %s", level, log); - ## } - ## webui_set_logger(myLogger, NULL); - ## proc set_config*(option: WebuiConfig; status: bool) {. webui, importc: "webui_set_config".} ## @@ -871,26 +782,6 @@ proc set_event_blocking*(window: csize_t; status: bool) {. ## ## @example webui_set_event_blocking(myWindow, true); ## -proc set_frameless*(window: csize_t; status: bool) {. - webui, importc: "webui_set_frameless".} - ## - ## @brief Make a WebView window frameless. - ## - ## @param window The window number - ## @param status The frameless status `true` or `false` - ## - ## @example webui_set_frameless(myWindow, true); - ## -proc set_transparent*(window: csize_t; status: bool) {. - webui, importc: "webui_set_transparent".} - ## - ## @brief Make a WebView window transparent. - ## - ## @param window The window number - ## @param status The transparency status `true` or `false` - ## - ## @example webui_set_transparent(myWindow, true); - ## proc get_mime_type*(file: cstring): cstring {.webui, importc: "webui_get_mime_type".} ## ## @brief Get the HTTP mime type of a file. @@ -1133,20 +1024,6 @@ proc return_bool*(e: ptr Event; b: bool) {.webui, importc: "webui_return_bool".} ## ## @example webui_return_bool(e, true); ## -proc get_last_error_number*(): csize_t {. - webui, importc: "webui_get_last_error_number".} - ## - ## @brief Get the last WebUI error code. - ## - ## @example int error_num = webui_get_last_error_number(); - ## -proc get_last_error_message*(): cstring {. - webui, importc: "webui_get_last_error_message".} - ## - ## @brief Get the last WebUI error message. - ## - ## @example const char* error_msg = webui_get_last_error_message(); - ## proc interface_bind*(window: csize_t; element: cstring; `func`: proc ( a1: csize_t; a2: csize_t; a3: cstring; a4: csize_t; a5: csize_t) {.webui.}): csize_t {. webui, importc: "webui_interface_bind".} diff --git a/webui/webui b/webui/webui index e1018c5..fd716dd 160000 --- a/webui/webui +++ b/webui/webui @@ -1 +1 @@ -Subproject commit e1018c5d8c251fad9fa8fc2f9d2d50af06bd2fed +Subproject commit fd716ddcac980eee9f8f0c6fb6a94a240343fad0