Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to WebUI v2.1.0 #7

Merged
merged 12 commits into from
Mar 31, 2023
Merged

Update to WebUI v2.1.0 #7

merged 12 commits into from
Mar 31, 2023

Conversation

hassandraga
Copy link
Member

#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
  • The getInt() and returnInt() are now 64bit integer instead of 32bit

#Breaking code

  • Switching from show(html, browser); to show(content);, and it's used for HTML, files, or reload the window
  • Removing showCopy(), refresh(), refreshCopy()

#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
* The `getInt()` and `returnInt()` are now 64bit integer instead of 32bit

#Breaking code
* Switching from `show(html, browser);` to `show(content);`, and it's used for HTML, files, or reload the window
* Removing `showCopy()`, `refresh()`, `refreshCopy()`
@hassandraga hassandraga changed the title Update to WebUI v2.0.7 Update to WebUI v2.1.0 Mar 29, 2023
@hassandraga
Copy link
Member Author

Sorry, the commit has the wrong title, Update to WebUI v2.0.7. I changed it to Update to WebUI v2.1.0.

@@ -249,10 +249,10 @@ proc scriptCleanup*(script: ptr Script) {.cdecl,
importc: "webui_script_cleanup", webui.}
proc scriptRuntime*(win: ptr Window; runtime: cuint) {.cdecl,
importc: "webui_script_runtime", webui.}
proc getInt*(e: ptr Event): cint {.cdecl, importc: "webui_get_int", webui.}
proc getInt*(e: ptr Event): int64 {.cdecl, importc: "webui_get_int", webui.}
Copy link
Contributor

@neroist neroist Mar 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use clonglong instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use clonglong for returnInt aswell.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, clonglong is better when interacting with a C/C++ library.

@AlbertShown
Copy link

LGTM.

@neroist
Copy link
Contributor

neroist commented Mar 29, 2023

Some of the core functions such as _webui_browser_start_vivaldi still need to be wrapped.

@AlbertShown
Copy link

AlbertShown commented Mar 29, 2023

I just wanted to let you know that you don't need to. The function show(content); will handle everything now.

show("<html>Hello</html>"); -> Show as HTML content.
show("index.html"); -> Show as a file.
show("second.html"); -> Navigate (Refresh).

@AlbertShown
Copy link

The browser's order is like this now.

@AlbertShown
Copy link

Usually, all function that starts with _webui_xxx does not need to be care of by the wrappers.

@neroist
Copy link
Contributor

neroist commented Mar 29, 2023

I know that, but I would still like them to be available, however.

@hassandraga
Copy link
Member Author

I know that, but I would still like them to be available, however.

Of course, that will be great. Something like showBrowser(content: string; browser: cuint).

showBrowser("<html>Hello World</html>", BrowserChrome);
showBrowser("index.html", BrowserFirefox);

@konsumer konsumer mentioned this pull request Mar 31, 2023
@hassandraga
Copy link
Member Author

This PR LGTM.

@neroist neroist merged commit bc6c508 into webui-dev:main Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants