Ultralight binding for Harbour

609 views
Skip to first unread message

Antonino Perricone

unread,
Sep 1, 2019, 10:26:55 AM9/1/19
to Harbour Users
Hello, 
I am proud to introduce you my last effort, It is a binding for ultralight.
Some time ago in this group I saw a post about a version of Electron for Harbour, Electron is (simplifying) a Javascript binding of CEF, Chromium Embedded Frameworks, 
The problem with CEF is that is very heavy, ultralight is smaller.

Very interesting is the sample 4, here we can see how load a HTML page, add a javascript function that is written in harbour and call javascript code from harbour.

The binding is in a embryonic state, but I think it is in a level that can be shared.
I am thinking to do a similar project with Sciter that is famouser, then see which is better for harbour

Regards,
Antonino Perricone

Eric Lendvai

unread,
Sep 1, 2019, 3:52:24 PM9/1/19
to Harbour Users
This is a fantastic new! 

Looking forward for trying this out.

Eric

Pritpal Bedi

unread,
Sep 1, 2019, 4:17:58 PM9/1/19
to Harbour Users
Hi

Looks promising. Welldone.

As I can see this can only be compiled with Visual Studo, on windows, or I am reading wrong ?
Do we have any mingw implementation on Windows ?

Pritpal Bedi
a student of software analysis & concepts

Pritpal Bedi

unread,
Sep 1, 2019, 7:47:38 PM9/1/19
to Harbour Users

Hi


And this is the result of hbultralight#sampl4 via mingw 5.3.0 and standarard Harbour 3.2.

I had to fic a couple of calls in ultralight_HBJS.c and tweaked a little .hbp files 


hbultralight.png



Impressive indeed. And can be used for some types of workloads.
As per ultralight developers, this is still a beta and may popup issues 
time-to-time so seems not appropriate for production use as of no, 
but eventually it will be.


Pritpal Bedi
a student of software anlysis & concepts
.

Antonino Perricone

unread,
Sep 2, 2019, 2:54:14 AM9/2/19
to Harbour Users
Hello,
I am planning to compile linux version this week, and release .lib and .a files.
I think the instabilities are on my code... It need more works.

Thanks for the support :)

Diego Fazio

unread,
Sep 2, 2019, 2:56:22 PM9/2/19
to Harbour Users
Hi Antonio, I tried running the sample1 and I took this error...

Sin título-1.jpg


This dll is included in Windows 8.1 and later. It's possible that Ultralight does not work in Windows 7 x86?


Thanks
Diego.

Pritpal Bedi

unread,
Sep 2, 2019, 3:39:02 PM9/2/19
to Harbour Users
Hi
 
Thanks for the support :)


There are some points for you to consider ( entirely upto you ):

0. Think that one day you are going to push it in Harbour contribs.
1. Structure youtr project on Harbour standards - writing style.
2. Look into any of contribs and structure your folder accordingly - "hbultralight"
    For examp, all sample1-4 should go in single folder "hbultralight/tests"
3. Attached is a quick simplification and contrib specific structure of your sources.

I have not wrote .hbc which will further simplyfy the build process.
I have also tweaked some functions which removes the build warnings 
emitted by mingw 5.3.0, I have also noticed that mingw lower than 5.3.0 
has issues with this librray. I have assumed that on windows ultralight 
binaries will be hosted in c:\ultralight.

I have not given any thought on code quality. But have just tweaked a couple of functions.
You can look into those.

A question, is there any function where window handle is supplied to a view 
instead of creating one with its own api. I hope it should exist since the target of this 
library is embedding.


Pritpal Bedi
a student of software analysis & concepts

Pritpal Bedi
hbultralight.zip

Antonino Perricone

unread,
Sep 3, 2019, 3:14:44 AM9/3/19
to Harbour Users
 Hello,
some answer:

0. Think that one day you are going to push it in Harbour contribs.
1. Structure your project on Harbour standards - writing style. 
2. Look into any of contribs and structure your folder accordingly - "hbultralight"
    For examp, all sample1-4 should go in single folder "hbultralight/tests"

No, why? 
And they are not the test, They don't do test cases...
It is not thought for harbour contrib, I need it, If someone want use it, He is free to do.

 
A question, is there any function where window handle is supplied to a view 
instead of creating one with its own api. I hope it should exist since the target of this 
library is embedding.

Ultralight is multi-platform, so the windows handle is out of context here... 
It is more a library issue not of my binding... 

I use company's style code at works, at home I use my way :)
I see your modification, some cast and some space... I will see the issues with GCC later on linux, there are some warning on windows too...

Regards.
Antonino

Antonino Perricone

unread,
Sep 3, 2019, 8:24:10 AM9/3/19
to Harbour Users
I added the hbc file, in this way is easier, thanks Pritpal 

About the error of Diego, can you take a look to https://github.com/ultralight-ux/ultralight/issues/50 
I will try the dev branch to see if it works as well as the release branch... maybe can you test it too...

Regards

Antonino Perricone

unread,
Sep 9, 2019, 3:19:53 PM9/9/19
to Harbour Users


Now with working browser sample 

browser.jpg


but it crashes on exit  

Eric Lendvai

unread,
Oct 11, 2019, 10:07:17 AM10/11/19
to Harbour Users
FYI, I just found out that Ultralight is not free for full scale commercial apps. Here is the info from https://ultralig.ht/

Licensing
Ultralight is free for non-commercial use, and free for commercial use by small indies (<$100K annual revenue). For info regarding pricing/terms for larger commercial projects please email ad...@ultralig.ht.

Electron is MIT, completely free.

Antonino Perricone

unread,
Oct 11, 2019, 10:49:17 AM10/11/19
to Harbour Users
Hi Eric,
For me 100K of annual revenue is a very far prospective... maybe I am too pessimistic :)

An alternative is CEF (license BSD) https://bitbucket.org/chromiumembedded/cef/src/master/ but the dll is very big (from http://opensource.spotify.com/cefbuilds/index.html win32 binary is 89Mb), so I don't know if it is a good idea.
Maybe I will do HBCEF or HarbourCef

Electron looks only for NodeJS. 
Maybe You know another C/C++ library
Reply all
Reply to author
Forward
0 new messages