Commit Graph

132 Commits

Author SHA1 Message Date
Hassan DRAGA
7d14be8eb0 Upgrade OpenSSL support from 2.x to 3.1.3 2023-10-21 19:40:38 -04:00
Hassan DRAGA
70e580334a TLS Encryption 2023-10-21 17:16:46 -04:00
Turiiya
bd715963f0 Run clang format 2023-10-11 18:33:20 +02:00
Hassan DRAGA
658a6c06e1 Regular Tab
- Now, if WebUI fails to find the browser, it will open the UI in the default web browser as a regular tab. This is better than exit the program and shows nothing.
2023-10-10 15:46:40 -04:00
Turiiya
50cc7619ba Format C code 2023-10-08 03:48:25 +02:00
Hassan DRAGA
c398d35dd0 Adding webui_interface_get_xxx_at
- Adding: webui_interface_get_string_at()
- Adding: webui_interface_get_int_at()
- Adding: webui_interface_get_bool_at()
- Fix crash bug when script result is empty
2023-10-06 20:00:46 -04:00
Hassan DRAGA
058f082cd2 Update e->bind_id for wrappers 2023-10-06 17:44:41 -04:00
Hassan DRAGA
6d5612c24d Fix Double Event
- Removed: webui_interface_get_bind_id()
- Add: webui_event_t -> size_t bind_id

Wrappers that have internal-event-handler may call by mistake the same callback twice when app use all-events. To fix this issue, simply wrappers should replace `webui_interface_get_window_id()` by `e.bind_id`.
2023-10-06 17:25:27 -04:00
Hassan DRAGA
b09c0dca94 Multi Arguments
- New: webui_get_int_at()
- New: webui_get_string_at()
- New: webui_get_bool_at()
- New: webui_get_size_at()
- Change: webui_interface_bind
- Removed: `e->data` becomes `webui_get_xxx_at(e, 0)`
2023-10-05 20:03:12 -04:00
Hassan DRAGA
39f9ab0cd7 Token Secured Requests
- Removed WEBUI_EVENT_MULTI_CONNECTION
- Removed WEBUI_EVENT_UNWANTED_CONNECTION
- Removed webui_set_multi_access()

- Core Added: Token Secured Requests
- Core Added: New Protocol Header
- Core Added: Block WS handshake for non-authorized connections
- Core Added:
2023-10-04 19:22:40 -04:00
Hassan DRAGA
aade3f2119 Update comments 2023-10-01 13:31:22 -04:00
Turiiya
61501ee959 Sort process_id functions in webui.h, update comment 2023-10-01 11:53:29 +02:00
Hassan DRAGA
91c9445912 Fast Events (Internal Core changes)
- Changing the way WS events process for more speed
- Changing the WS events process for less data copy as possible
2023-09-30 23:15:55 -04:00
Hassan DRAGA
24a68d87a6 Update webui_browsers struct
- Adding `NoBrowser = 0,` (The rest is shifted by one)
2023-09-30 16:55:48 -04:00
Hassan DRAGA
62030156e5 Adding webui_delete_all_profiles
- Adding webui_delete_all_profiles()
- Adding webui_delete_profile()
- Adding webui_clean()
- Now. webui_wait() simply means no more windows are running. And app can create and show windows. And of program is now become webui_clean().
- Updating Civetweb (Server close faster now)
2023-09-30 16:26:58 -04:00
Hassan DRAGA
2f694d1a3f Adding webui_clean
- Adding webui_clean() (Firefox not supported yet)
2023-09-29 18:36:57 -04:00
Hassan DRAGA
6a634cc680 Adding webui_navigate
- Adding webui_navigate()
- Now when using all events webui_bind(MyWindow, "", events), WebUI will block all href requests
- Fix https://github.com/webui-dev/webui/issues/228
2023-09-26 18:59:25 -04:00
Turiiya
ea50923288 Add ChromiumBased to webui_browsers enum 2023-09-22 09:05:03 +02:00
Hassan DRAGA
a068a84320 Updating webui_get_url 2023-09-21 16:36:11 -04:00
fibodevy
6f782bc1a8 Adding webui_get_url
- Adding `char* webui_get_url(size_t window);`
2023-09-21 07:21:04 +02:00
Hassan DRAGA
a616991ca6 Adding webui_set_profile
- Adding `void webui_set_profile(size_t window, const char* name, const char* path)`
- Fix disconnection on 404
- Fix `webui_get_child_process_id()`
- Adding argument `--disable-component-update`
2023-09-19 19:34:09 -04:00
Hassan DRAGA
2160aea9b0 Adding process ID APIs
* Adding `size_t webui_get_child_process_id(size_t window)`
* Adding `size_t webui_get_parent_process_id(size_t window)`
2023-09-14 17:31:29 -04:00
Hassan DRAGA
ea63be7921 Adding comments (Not finished) 2 2023-09-13 15:32:14 -04:00
Hassan DRAGA
940dcc50af Adding comments (Not finished) 2023-09-11 18:09:42 -04:00
Hassan DRAGA
be9c0bc7cb Reorganize webui.h 2023-09-11 17:18:31 -04:00
Hassan DRAGA
d2bf059d4e Change signed long to unsigned
- The JavaScript data size should be unsigned `size_t` instead of `signed long long`
2023-08-30 19:47:31 -04:00
Albert Shown
e91d6d70bf Adding webui_set_size and webui_set_position
* Adding `webui_set_size()`
* Adding `webui_set_position()`
2023-08-28 18:45:52 -04:00
Hassan DRAGA
9574724f99
Merge pull request #179 from ttytm/docs/refine-comments
Refine API comments
2023-08-25 10:35:36 -04:00
Hassan DRAGA
94a3db07b7 Fix https://github.com/webui-dev/webui/issues/180
* Update `CLOSE` command
* Update bridge
2023-08-25 10:24:41 -04:00
Turiiya
ee66862f87 Refine API comments 2023-08-25 07:59:14 +02:00
Hassan DRAGA
74830815cd Adding webui_set_default_root_folder()
* Adding `webui_set_default_root_folder()`
* Fix non initialized webui-core in some scenarios
2023-08-24 21:54:13 -04:00
Hassan DRAGA
0d400644d1 Adding DataSize to wrappers interface
* Adding DataSize to wrappers interface `webui_interface_bind()`
2023-08-22 22:13:58 -04:00
Hassan DRAGA
e941e35fc6 Send Raw to backend
* Send Raw to backend
* Updating bridge
* No memory copy when source is UI as is guaranteed to stay alive
2023-08-22 18:11:35 -04:00
Hassan DRAGA
52885648d2 Up to v2.4.0
* Up all to v2.4.0
2023-08-19 17:49:08 -04:00
Hassan DRAGA
28274c53e8 New API webui_set_hide
* Adding `webui_set_hide()` to run the window in hidden mode
2023-08-18 18:16:35 -04:00
Hassan DRAGA
ba84f249b5 New API webui_send_raw
* Adding `webui_send_raw()` to be able to send raw binary data to UI
* Soon I will add UI to Backend
2023-08-18 16:16:07 -04:00
Albert Shown
0b55abff5a Finished webui_set_file_handler API
* Finishing the `webui_set_file_handler()` feature. Thanks to @petabyt
* Removing `free()` and replace it by the WebUI version
* Minor core changes to make `webui_set_file_handler()` working
* Update serve a folder example to show how to use `webui_set_file_handler()`

## New Public API:
* `void webui_set_file_handler(size_t window, const void* (*handler)(const char* filename, int* length))`
* `void* webui_malloc(size_t size)`
2023-06-26 12:11:03 -04:00
Daniel C
20f828a47f Add webui_set_file_handler
Allows a handler to be given to the file server to return embedded content, as well as allocated content
2023-06-24 16:03:19 -04:00
Hassan DRAGA
d786f6db2a Adding webui_set_root_folder
* Adding New API `bool _webui_set_root_folder(_webui_window_t* win, const char* path)`
2023-05-27 20:30:31 -04:00
Hassan DRAGA
cdf67b17ac C++ Improvement
* Set C++11 as minimal standard
* Fix C++ Makefile in macOS
* Update the C++ WebUI header to use references (https://github.com/webui-dev/webui/issues/103)
* Update `webui_return_string()` argument from `char*` to `const char*`
2023-05-21 12:20:54 -04:00
Hassan DRAGA
7db9826676 Updating the links
* Updating the links to the new organization
2023-05-13 10:47:42 -04:00
Hassan DRAGA
bc5e5b2a56 Public get_new_window_id
# New
* `webui_get_new_window_id` is now public
* Updating C++ examples
2023-05-09 07:48:27 -04:00
Hassan DRAGA
4e0a7fe5c1 Text Editor Example
# Changes
* `webui_run` changed from `bool` to `void` as it run the script fast with no return

# New
* `char* webui_encode(const char* str)` encode string to base64
* `char* webui_decode(const char* str)` decode base64 to string
* `void webui_free(void* ptr)` free resource allocated by WebUI (_when using webui_encode()_)
* A text editor example

# Fix
* Now WebUI wait in loop while the application requestion more html files (_Large HTML UI_)
2023-05-08 23:03:41 -04:00
Hassan DRAGA
aacc8b0ddd Window ID Based Creation
# New:

* New API: `void webui_new_window_id(size_t window_number)`
* New API: `void webui_destroy(size_t window)`

_Please see C serve_a_folder example on how to use webui_new_window_id()_

# Changes

* To keep consistency with window IDs, all `unsigned int` changed to `size_t`
2023-05-07 13:54:15 -04:00
Albert Shown
e116261130 C++ Wrapper Update
* Now the C++ wrapper has its own class instead of direct C calls.
2023-05-05 17:41:20 -04:00
Hassan DRAGA
ca7b4f50ed WebUI v2.3.0
# Users/Wrappers Changes
* The window object changed from `void*` (pointer) to a simple `size_t` (integer)

# New Core Features And Changes
* License changed from `GPLv2` to 'MIT'. Thanks to @xD0135
* The core APIs is completely changed from `Mongoose` to `civetweb`. Thanks to @xD0135
* Kiosk mode support. Thanks to @malisipi
* UI responses resolving using IDs instead of first received (WebUI-JS-Bridge)
* Fix C++ Linux Clang build issue (C++ Linux GCC still broken)
2023-05-04 21:41:03 -04:00
Hassan DRAGA
41b5ab3bd7 Updating the PR
* The original code works. I'm just re-styling it to make the WebUI code look the same.
2023-05-03 20:18:56 -04:00
Hassan DRAGA
591020ffc5
Update webui.h 2023-05-03 19:57:48 -04:00
Hassan DRAGA
29694c40cf
Update webui.h 2023-05-03 19:55:46 -04:00
Mehmet Ali Şipi
537d5a677a Add Kiosk Support For Chrome 2023-05-03 16:59:21 +03:00
Hassan DRAGA
866796c8d2 Event Struct Improvement
* In webui_event_t `type` changed to `event_type`. This is because some wrapper's language does not support using _type_ as a variable name.
* In webui_event_t `char* response` changed to `unsigned int event_number`.
* Now `webui_interface_set_response()` use a simple `unsigned int event_number` instead of `char* response`.
2023-04-29 13:46:11 -04:00
Albert Shown
f4f168c912 Fix TCC (tlhelp32.h) issue
* Removing auto-running browser detection from TCC build
2023-04-26 18:15:55 -04:00
Albert Shown
296dfdc0b4 Go & C++ Documentation
* Adding Go Documentation
* Adding C++ Documentation
* Removing TCC warnings
2023-04-25 17:56:57 -04:00
Albert Shown
3a0cd4968f Memory Optimization
* Implementing https://github.com/alifcommunity/webui/issues/81
* Fix Linux & macOS build script using `dos2unix`
2023-04-24 17:44:27 -04:00
Hassan DRAGA
e1d8f3f43c Linux and macOS Support
* Linux Support
* macOS Support
* Python Wrapper Finished
2023-04-20 22:18:32 -04:00
Hassan DRAGA
04b3ab7734 Python Wrapper (Not Complete)
* First Python Wrapper Commit v2.2.0 (Not Complete)
* Adding `windows_build.bat`
2023-04-19 22:52:56 -04:00
Hassan DRAGA
18d68ab586 First WebUI v2.2.0 Commit
# WebUI v2.2.0

* Now, creating a wrapper is easier as core functions have been removed from `webui.h`
* Removing many functions (webui_open, webui_new_server...)

* C - Complete
* Go - Complete
* Deno - Complete
* All other things still need to be completed...
2023-04-17 15:43:46 -04:00
Albert Shown
0e6ac9b813 Minor C style code changes
* Minor C style code changes, no new features.
2023-04-04 11:28:13 -04:00
Hassan DRAGA
9a38611454 WebUI v2.1.1
* Fix MacOS threading bug `wait()`
* Removing all `bind_all` related codes
* Now, you can listen for general events by binding with an empty ID
2023-04-01 00:05:41 -04:00
Hassan DRAGA
b7bf608240 WebUI v2.1.0
#New Features
* Supporting more web browsers
* Search for web browsers in Windows Reg.
* Using the same show() function for HTML script, files, and refresh content
* Support Chrome on macOS

#Breaking code
* Switching from `webui_show(win, html, browser);` to `webui_show(win, content);`, and it's used for HTML, files, and reload the window
* Removing `webui_show_cpy()`, `webui_refresh()`, `webui_refresh_cpy()`
2023-03-28 23:00:09 -04:00
Charles Lowell
599d452a70
Add a build for MacOS
This copies the Linux build to generate binaries for MacOS
2023-03-28 15:50:10 -05:00
Albert Shown
1a1e4c7a00 WebUI v2.0.7
* Switch from GPL to LGPL
* Deno example is ready
* Adding `void _webui_free_all_mem()` to release all dynamic mem at exit
* Break Change `void webui_script_interface(webui_window_t* win, const char* script, unsigned int timeout, bool* error, unsigned int* length, char* data)` to `void webui_script_interface(webui_window_t* win, const char* script, unsigned int timeout, bool* error, unsigned int* length, char** data)`
* Updating readme
* Moving Zig build file into build folder

More code cleaning and more examples is needed before we release the version 2.0.7.
2023-03-21 18:47:19 -04:00
Albert Shown
9c14eef124 New Feature - Supporting local files & embedded HTML
* Supporting external local files when using embedded HTML code
2023-03-03 15:49:34 -05:00
Albert Shown
6991c02abc WebUI 2.0.6
* Supporting href link
* Python serve a folder example
* Fix bug in Infinite loop when set_timeout() get called later
* webui.js wont close window if href link clicked
* Fix bug in webui.js show error message when switching between window fast
2023-03-01 18:16:24 -05:00
Albert Shown
a286d756f4 Call C with args from JS
* Updating the interface APIs to call background with args from UI
* Auto log enabled in debug build
2022-12-12 10:13:27 -05:00
Albert Shown
b09ab69200 Call C from JS with response
* Adding the possibility of calling C from JS and wait for the response
2022-11-28 11:04:45 -05:00
Albert Shown
c5758b1ddd v2.0.5
* Adding webui_fn()
* Cleaning JS Bridge
* Rename internal element ID to easy reading the code
* Adding Data to the E event struct
2022-11-21 18:07:46 -05:00
Albert Shown
a96de5e810 Process based call
* Try to close browser if main closes
* Serve a Folder call
2022-11-11 17:19:37 -05:00
Hassan DRAGA
86838172a0 v2.0.4
* Minor bug fix
* Python Docs
* Update Python Wrapper
* Fix C VS Studio broken project
2022-11-07 23:33:03 -05:00
Hassan DRAGA
1cebf03d60 C Documentation and APIs Improvement
* Adding C Documentation
* Improve the API call
2022-11-02 21:43:48 -04:00
Hassan DRAGA
d7c62fc8d7 v2.0.3 fix
* Fix bank screen in python module (webui.show())
* Fix getaddrinfo() crash sometimes
* Fix wait() typo
* Fist Rust complete wrapper
2022-11-01 00:26:09 -04:00
Hassan DRAGA
8c77d0b056 v2.0.3 - TypeScript Dynamic Lib
- TypeScript Dynamic Lib
- Incomplete Rus wrapper
- Rename of many API's
- Clean all batch script
2022-10-29 21:41:20 -04:00
Hassan DRAGA
5fc7fb2455 v2.0.2 With full Linux support 2022-10-24 22:35:05 -04:00
Hassan DRAGA
2856dffbdf Incomplete Linux & Website codes 2022-10-23 20:06:15 -04:00
Hassan DRAGA
c71065e8de Multiple Fix
Fix the WS speed
Fix timeout long
Add VS2019/2022
2022-10-20 22:21:52 -04:00
Hassan DRAGA
92d4cbe15c New interface 2022-10-19 19:48:47 -04:00
Hassan DRAGA
937ab1cda5 WebUI 2.0.1 2022-10-19 00:38:54 -04:00
Hassan DRAGA
1c1da406bb Golang first example 2022-09-29 21:03:57 -04:00
Hassan DRAGA
62624a9971 JS and TS examples 2022-09-29 04:32:28 -04:00
Hassan DRAGA
53efaaea51 Using build folder 2022-09-28 19:41:24 -04:00
Hassan DRAGA
f2ba7538f1 Update Python Bridge 2022-09-25 20:05:49 -04:00
Hassan DRAGA
a89dfd8a2d WebUI 2.0 2022-09-24 19:35:56 -04:00