HB_WebView (a cross-platform Webview library)

640 views
Skip to first unread message

Claudio Soto

unread,
Mar 21, 2025, 8:59:55 PMMar 21
to Harbour Users
Hi all,

I have developed HB_WebView a Harbour wrapper for Webview library.

Webview library is a tiny cross-platform webview library for C/C++ to build modern cross-platform GUIs.
The goal of the Webview library is to create a common HTML5 UI abstraction layer for the most widely used platforms.
It supports two-way JavaScript bindings (to call JavaScript from C/C++ and to call C/C++ from JavaScript).

Now with HB_Webview you can easily bind HB/HMG functions with Javascript, that is, you can call any HB/HMG function from an HTML page.

The first four demos are written in pure Harbour (cross-platform demos), while demo_hmg.prg is an integration of the previous examples integrated into the HMG environment (Windows platform demo).

For example, bind Harbour functions:

context1 = hb_webview_bind2(w, "callHB",       HB_CALL_FUNC_INDIRECT)  // e.g. call from JS: callHB( "hb_memoread", "text.txt" )
context2 = hb_webview_bind2(w, "callMACRO",    HB_CALL_FUNC_MACRO)     // e.g. call from JS: callMACRO( 'hb_memoread("text.txt")' )

context3 = hb_webview_bind2(w, "hb_memoread",  HB_CALL_FUNC_DIRECT)    // e.g. call from JS: hb_memoread( "text.txt" )
context4 = hb_webview_bind2(w, "hb_alert",     HB_CALL_FUNC_DIRECT)    // e.g. call from JS: hb_alert( "Hello Harbour" )

See documentation in HB_WebView.pdf file.

The source code and demos can be downloaded from:

https://www.hmgforum.com/viewtopic.php?t=7659

I hope it is useful to you!

Best Regards,
Claudio

KennyOoi

unread,
Mar 22, 2025, 8:17:28 AMMar 22
to Harbour Users
hi Claudio Soto ,

unable to open page [The board requires you to be registered and logged in to view this forum.],unfortunately i can't register.been email to admin but no response last 3 years.

Best Regards,
kenny ooi

Takács Gábor

unread,
Mar 22, 2025, 11:15:26 AMMar 22
to harbou...@googlegroups.com
Hi Claudio,

Cannot log in!



--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/cd885af9-bc6d-43e2-995f-e9751c06e6d5n%40googlegroups.com.

Angel Pais

unread,
Mar 22, 2025, 11:20:55 AMMar 22
to harbou...@googlegroups.com
What's the difference with hbWUI ?
It was published in 2021.

Regards
Angel

Claudio Soto

unread,
Mar 22, 2025, 4:48:35 PMMar 22
to Harbour Users
Hi all,
try download from:

Best Regards,
Claudio

PS: in batch files attachment the compilers (Harbour and mingw64) root path was established as C:\hmg.3.6\

Claudio Soto

unread,
Mar 22, 2025, 4:54:42 PMMar 22
to Harbour Users
Hi Angel,
I wasn't familiar with hbwui. I just took a quick look at the hbwui code on GitHub. Maybe they're similar.
Regards,
Claudio

El sábado, 22 de marzo de 2025 a las 12:20:55 UTC-3, Angel Pais escribió:

Takács Gábor

unread,
Mar 22, 2025, 6:51:34 PMMar 22
to harbou...@googlegroups.com
Hi,

Thank you  download, and test soon
Thank you!

Eric Lendvai

unread,
Mar 25, 2025, 2:12:33 AMMar 25
to Harbour Users
Hello Claudio and all Harbour Developers.

I also had a repo for the webview binding a while ago, with complete source code.
And a video "How to make Harbour desktop apps using web technologieshttps://www.youtube.com/watch?v=iDOr9B-9TYk

I did not have it working for Windows, since  I never used cmake on linux or mac.
Thanks for your contribution, maybe this will help me port my own app to other platforms.

In the way the framework I created I show an actual multi window application using Harbour multi-threading.

Takács Gábor

unread,
Mar 28, 2025, 8:45:32 AMMar 28
to harbou...@googlegroups.com

Claudio Soto

unread,
Mar 28, 2025, 10:04:11 PMMar 28
to Harbour Users
Hi Eric, 
very nice!, thanks for sharing. 
Best regards, 
Claudio

Claudio Soto

unread,
Mar 29, 2025, 2:27:49 PMMar 29
to Harbour Users
Hi all,
I've added a new demo.
demo6.prg: You can navigate the directory tree and open files that are in the list of allowed extensions (new instances of HB_WebView are created entirely from Javascript code).

I made minor changes to hb webview.prg to automatically support translation between UTF8 and the ANSI Harbour code page.
See demo6 and documentation (hb_webview_bind2 and hb_webview_translate_ansi_codepage functions).

Download from:
https://drive.google.com/open?id=1gCRK__9fylXj29D28DuAnMJXqbcgej7O&usp=drive_fs

Best regards,
Claudio

PS:
Demos written in pure Harbor (cross-platform demos):

demo1.prg - Web browsing in Harbour
demo2.prg - Binding Harbour functions (calling HB functions from Javascript)
demo3.prg - Inspecting DBF files with Javascript
demo4.prg - Injecting PRG code written entirely in Harbour from JavaScript
demo5.prg - Querying SQLite from Javascript
demo6.prg: You can navigate the directory tree and open files that are in the list of allowed extensions (new instances of HB_WebView are created entirely from Javascript code).

Demos in HMG:
demo hmg.prg - is an integration of the previous examples integrated into the HMG environment (Windows platform demo)


See documentation in HB_WebView.pdf file.

Reply all
Reply to author
Forward
0 new messages