SWV: A simple HTML/JS desktop GUI engine for PB

Everything else that doesn't fall into one of the other PB categories.
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

SWV: A simple HTML/JS desktop GUI engine for PB

Post by firace »

I am working on a Simple Webview control (hence the name: SWV) for PB developers, designed to be more useful and flexible than the standard WebGadget, while still being very lightweight.

SWV's primary purpose is to facilitate building HTML/JS GUIs for PureBasic desktop applications.
It aims to provide tight integration and seamless two-way communication between JS and PB.

Note that for security reasons, SWV is not intended, and not optimized for web browsing.


The SWV control will offer the following functions:
  • SWV_New

    SWV_SetUserAgent

    SWV_SetLocation

    SWV_GetLocation

    SWV_SetHTML

    SWV_GetHTML

    SWV_SetDOM

    SWV_GetDOM

    SWV_RunJS

    SWV_Resize

    SWV_Free



A couple screenshots:

Image

Image

Image

I will release SWV as a very easy-to-use DLL (for a reasonable price), if enough people are interested.

So please share your thoughts / questions / suggestions :)

However do keep in mind that I will be travelling the next few days and might take a while to respond.


Edit: Demo #1 is available!


https://www.radsix.com/files_swv/SWV_De ... ve_x86.zip (Download size: 91KB)

Unzip the package to a location of your choice (preserving the folder structure),
and either just run the demo executable, or compile it from source.

Notes:
This is a very early preview for demonstration purposes only, so be aware that many UI elements have no effect, and only a subset of the intended functionality has been implemented.

Have a look at the sample applications, and be sure to check out the test view by pressing F12.

Keep in mind that to build an HTML/JS UI for your desktop application, a UI framework is required in addition to SWV.
The following popular frameworks are confirmed to be supported so far:
  • BootStrap
    Pure.css
    Bulma.css
    Mint.css
All comments, bug reports, suggestions welcome :)

If there's enough interest, a CEF (Chromium) version will follow, but of course keep in mind that resulting applications will be much much bigger (about 130MB for a simple Hello world application, vs 100-150KB for the current native version).
Last edited by firace on Wed Feb 19, 2020 7:07 pm, edited 16 times in total.
Fred
Administrator
Administrator
Posts: 16581
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: SWV: A better webview control

Post by Fred »

Looks very interesting, on which browser code is it based ?
User avatar
Kiffi
Addict
Addict
Posts: 1346
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: SWV: A better webview control

Post by Kiffi »

That sounds promising. But only if it does not use the Internet Explorer.

Greetings ... Peter
Hygge
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: SWV: A better webview control

Post by chi »

Nice, looking forward to it ^^
Et cetera is my worst enemy
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: SWV: A better webview control

Post by firace »

Fred wrote:Looks very interesting, on which browser code is it based ?
I am making it for both Trident (with hardware acceleration) and Chromium.
Tests are looking good on both engines so far.

The Chromium version will certainly take a little more time to complete, but for desktop GUI rendering purposes, the Trident version should be quite usable already.
ozzie
Enthusiast
Enthusiast
Posts: 429
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: SWV: A better webview control

Post by ozzie »

Looking forward to the demo!
diskay
User
User
Posts: 25
Joined: Sun Aug 02, 2015 7:17 pm

Re: SWV: A better webview control

Post by diskay »

User avatar
the.weavster
Addict
Addict
Posts: 1531
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: SWV: A better webview control

Post by the.weavster »

I'd rather pay firace a few bob and avoid the frustration of trying to figure that out :wink:
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: SWV: A better webview control

Post by firace »

the.weavster wrote:
I'd rather pay firace a few bob and avoid the frustration of trying to figure that out :wink:
Yes using SWV should be much easier to figure out :)

A couple more screenshots (SWV + Bootstrap UI theme):

Image

Image
User avatar
Kiffi
Addict
Addict
Posts: 1346
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: SWV: A better webview control

Post by Kiffi »

@firace: Can you do me a favor and test the following page?

https://www.spiderbasic.com/showcase/on ... rview.html

This is a demonstration of the SpiderBasic gadgets. When I display the page in a PureBasic WebGadget (Internet Explorer), I can't select the ListView and ListIconGadget entries with the mouse.

Thanks in Advance & greetings ... Peter
Hygge
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: SWV: A better webview control

Post by firace »

Kiffi wrote:@firace: Can you do me a favor and test the following page?

https://www.spiderbasic.com/showcase/on ... rview.html

This is a demonstration of the SpiderBasic gadgets. When I display the page in a PureBasic WebGadget (Internet Explorer), I can't select the ListView and ListIconGadget entries with the mouse.

Thanks in Advance & greetings ... Peter
I just tested it and yes, I do see issues with selection on those gadgets when using the IE11-based web control. In fact the browser control does appear to pick up the mouse events (see below screenshot), but does not highlight the selected item for some reason. I will try using the CEF (Chromium) engine later.

Image
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: SWV: A better webview control

Post by firace »

And here's a first little demo:

https://www.radsix.com/files_swv/SWV_De ... ve_x86.zip

Unzip the package to a location of your choice (preserving the folder structure),
and either just run the executable, or compile it from source (SWV_EXE_X6.pb)

Notes:
This is a very early preview for demonstration purposes only, so be aware that many UI elements have no effect, and only a subset of the intended functionality has been implemented.

Have a look at the sample applications, and be sure to switch to the full test view by pressing F12.

Keep in mind that to build an HTML/JS UI for your desktop application, a UI framework is required in addition to SWV.
The following popular frameworks are confirmed to be supported so far:
  • BootStrap
    Pure.css
    Bulma.css
    Mint.css
All comments, bug reports, suggestions welcome :)

If there's enough interest, a CEF (Chromium) version will follow, but of course keep in mind that resulting applications will be much much bigger (about 100MB for a simple Hello world application, vs 100KB for the current native version).
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: SWV: A better webview control

Post by Kwai chang caine »

If i have good understand, it's not a webbrowser, but a GUI application like PB but create with local HTML5/CSS, you can't go to a site on the web ?
Works great here, thanks for your demonstration 8)
ImageThe happiness is a road...
Not a destination
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: SWV: A better webview control

Post by srod »

Works well here on Win 7. Had to change the compiler settings so that the temporary exe is created in the source directory - otherwise the html file is not found.

Very impressive. :shock:

I take it that is using the Trident engine?

Will the chromium version be cross-platform?
I may look like a mule, but I'm not a complete ass.
User avatar
Kiffi
Addict
Addict
Posts: 1346
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: SWV: A better webview control

Post by Kiffi »

I'm sorry to say it, but SWV scores too low on HTML5test

Image

(Btw: i'm using Windows 10)

CEF would get a higher score, but there is already the PB.Ex WebGadget (Windows) (WebKit) from RSBasic.

Greetings ... Peter
Hygge
Post Reply