55include ./ bindings_prefix.nim
66
77const
8- WEBUI_VERSION * = " 2.5.0-beta.4 " # #
8+ WEBUI_VERSION * = " 2.5.0-beta.3 " # #
99 # # WebUI Library
1010 # # https://webui.me
1111 # # https://github.com/webui-dev/webui
@@ -145,11 +145,6 @@ type
145145 cookies* : cstring
146146 # # Client's full cookies
147147
148- WebuiLoggerLevel * {.renameEnumFields .} = enum
149- WEBUI_LOGGER_LEVEL_DEBUG = 0 , # # 0. All logs with all details
150- WEBUI_LOGGER_LEVEL_INFO , # # 1. Only general logs
151- WEBUI_LOGGER_LEVEL_ERROR # # 2. Only fatal error logs
152-
153148
154149proc new_window * (): csize_t {.webui , importc : " webui_new_window" .}
155150 # # -- Definitions ---------------------
@@ -340,17 +335,6 @@ proc set_high_contrast*(window: csize_t; status: bool) {.
340335 # #
341336 # # @example webui_set_high_contrast(myWindow, true);
342337 # #
343- proc set_resizable * (window: csize_t ; status: bool ) {.
344- webui , importc : " webui_set_resizable" .}
345- # #
346- # # @brief Sets whether the window frame is resizable or fixed.
347- # # Works only on WebView window.
348- # #
349- # # @param window The window number
350- # # @param status True or False
351- # #
352- # # @example webui_set_resizable(myWindow, true);
353- # #
354338proc is_high_contrast * (): bool {.webui , importc : " webui_is_high_contrast" .}
355339 # #
356340 # # @brief Get OS high contrast preference.
@@ -382,22 +366,6 @@ proc close*(window: csize_t) {.webui, importc: "webui_close".}
382366 # #
383367 # # @example webui_close(myWindow);
384368 # #
385- proc minimize * (window: csize_t ) {.webui , importc : " webui_minimize" .}
386- # #
387- # # @brief Minimize a WebView window.
388- # #
389- # # @param window The window number
390- # #
391- # # @example webui_minimize(myWindow);
392- # #
393- proc maximize * (window: csize_t ) {.webui , importc : " webui_maximize" .}
394- # #
395- # # @brief Maximize a WebView window.
396- # #
397- # # @param window The window number
398- # #
399- # # @example webui_maximize(myWindow);
400- # #
401369proc close_client * (e: ptr Event ) {.webui , importc : " webui_close_client" .}
402370 # #
403371 # # @brief Close a specific client.
@@ -430,14 +398,6 @@ proc set_root_folder*(window: csize_t; path: cstring): bool {.
430398 # #
431399 # # @example webui_set_root_folder(myWindow, "/home/Foo/Bar/");
432400 # #
433- proc set_browser_folder * (path: cstring ) {.webui , importc : " webui_set_browser_folder" .}
434- # #
435- # # @brief Set custom browser folder path.
436- # #
437- # # @param path The browser folder path
438- # #
439- # # @example webui_set_browser_folder("/home/Foo/Bar/");
440- # #
441401proc set_default_root_folder * (path: cstring ): bool {.
442402 webui , importc : " webui_set_default_root_folder" .}
443403 # #
@@ -448,20 +408,6 @@ proc set_default_root_folder*(path: cstring): bool {.
448408 # #
449409 # # @example webui_set_default_root_folder("/home/Foo/Bar/");
450410 # #
451- proc set_close_handler_wv * (window: csize_t ;
452- close_handler: proc (window: csize_t ): bool {.webui .}) {.
453- webui , importc : " webui_set_close_handler_wv" .}
454- # #
455- # # @brief Set a callback to catch the close event of the WebView window.
456- # # Must return `false` to prevent the close event, `true` otherwise.
457- # #
458- # # @example
459- # # bool myCloseEvent(size_t window) {
460- # # // Prevent WebView window close event
461- # # return false;
462- # # }
463- # # webui_set_close_handler(myWindow, myCloseEvent);
464- # #
465411proc set_file_handler * (window: csize_t ; handler: proc (filename: cstring ;
466412 length: ptr cint ): pointer {.webui .}) {.webui , importc : " webui_set_file_handler" .}
467413 # #
@@ -645,15 +591,6 @@ proc set_position*(window: csize_t; x: cuint; y: cuint) {.
645591 # #
646592 # # @example webui_set_position(myWindow, 100, 100);
647593 # #
648- proc set_center * (window: csize_t ) {.webui , importc : " webui_set_center" .}
649- # #
650- # # @brief Centers the window on the screen. Works better with
651- # # WebView. Call this function before `webui_show()` for better results.
652- # #
653- # # @param window The window number
654- # #
655- # # @example webui_set_center(myWindow);
656- # #
657594proc set_profile * (window: csize_t ; name: cstring ; path: cstring ) {.
658595 webui , importc : " webui_set_profile" .}
659596 # #
@@ -758,7 +695,8 @@ proc delete_profile*(window: csize_t) {.webui, importc: "webui_delete_profile".}
758695proc get_parent_process_id * (window: csize_t ): csize_t {.
759696 webui , importc : " webui_get_parent_process_id" .}
760697 # #
761- # # @brief Get the parent process ID, which refers to the current backend application process.
698+ # # @brief Get the ID of the parent process (The web browser may re-create
699+ # # another new process).
762700 # #
763701 # # @param window The window number
764702 # #
@@ -769,10 +707,7 @@ proc get_parent_process_id*(window: csize_t): csize_t {.
769707proc get_child_process_id * (window: csize_t ): csize_t {.
770708 webui , importc : " webui_get_child_process_id" .}
771709 # #
772- # # @brief Get the child process ID created by the parent, which refers to the web browser window.
773- # #
774- # # Note: In WebView mode, this will return the parent process ID because the backend and the
775- # # WebView window run in the same process.
710+ # # @brief Get the ID of the last child process.
776711 # #
777712 # # @param window The window number
778713 # #
@@ -792,19 +727,6 @@ proc win32_get_hwnd*(window: csize_t): pointer {.
792727 # #
793728 # # @example HWND hwnd = webui_win32_get_hwnd(myWindow);
794729 # #
795- proc get_hwnd * (window: csize_t ): pointer {.webui , importc : " webui_get_hwnd" .}
796- # #
797- # # @brief Get window `HWND`. More reliable with WebView
798- # # than web browser window, as browser PIDs may change on launch.
799- # #
800- # # @param window The window number
801- # #
802- # # @return Returns the window `hwnd` in Win32, `GtkWindow` in Linux.
803- # #
804- # # @example
805- # # HWND hwnd = webui_get_hwnd(myWindow); // Win32 (Work with WebView and web browser)
806- # # GtkWindow* window = webui_get_hwnd(myWindow); // Linux (Work with WebView only)
807- # #
808730proc get_port * (window: csize_t ): csize_t {.webui , importc : " webui_get_port" .}
809731 # #
810732 # # @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".}
837759 # #
838760 # # @example size_t port = webui_get_free_port();
839761 # #
840- proc set_logger * (`func`: proc (level: csize_t ; log: cstring ; user_data: pointer ) {.webui .};
841- user_data: pointer ) {.webui , importc : " webui_set_logger" .}
842- # #
843- # # @brief Set a custom logger function.
844- # #
845- # # @example
846- # # void myLogger(size_t level, const char* log, void* user_data) {
847- # # printf("myLogger (%d): %s", level, log);
848- # # }
849- # # webui_set_logger(myLogger, NULL);
850- # #
851762proc set_config * (option: WebuiConfig ; status: bool ) {.
852763 webui , importc : " webui_set_config" .}
853764 # #
@@ -871,26 +782,6 @@ proc set_event_blocking*(window: csize_t; status: bool) {.
871782 # #
872783 # # @example webui_set_event_blocking(myWindow, true);
873784 # #
874- proc set_frameless * (window: csize_t ; status: bool ) {.
875- webui , importc : " webui_set_frameless" .}
876- # #
877- # # @brief Make a WebView window frameless.
878- # #
879- # # @param window The window number
880- # # @param status The frameless status `true` or `false`
881- # #
882- # # @example webui_set_frameless(myWindow, true);
883- # #
884- proc set_transparent * (window: csize_t ; status: bool ) {.
885- webui , importc : " webui_set_transparent" .}
886- # #
887- # # @brief Make a WebView window transparent.
888- # #
889- # # @param window The window number
890- # # @param status The transparency status `true` or `false`
891- # #
892- # # @example webui_set_transparent(myWindow, true);
893- # #
894785proc get_mime_type * (file: cstring ): cstring {.webui , importc : " webui_get_mime_type" .}
895786 # #
896787 # # @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".}
11331024 # #
11341025 # # @example webui_return_bool(e, true);
11351026 # #
1136- proc get_last_error_number * (): csize_t {.
1137- webui , importc : " webui_get_last_error_number" .}
1138- # #
1139- # # @brief Get the last WebUI error code.
1140- # #
1141- # # @example int error_num = webui_get_last_error_number();
1142- # #
1143- proc get_last_error_message * (): cstring {.
1144- webui , importc : " webui_get_last_error_message" .}
1145- # #
1146- # # @brief Get the last WebUI error message.
1147- # #
1148- # # @example const char* error_msg = webui_get_last_error_message();
1149- # #
11501027proc interface_bind * (window: csize_t ; element: cstring ; `func`: proc (
11511028 a1: csize_t ; a2: csize_t ; a3: cstring ; a4: csize_t ; a5: csize_t ) {.webui .}): csize_t {.
11521029 webui , importc : " webui_interface_bind" .}
0 commit comments