wxWebConnect 1.0 released: web browser library for wxWidgets

Do you like to promote your wxWidgets based application or component!? Post it here and let's see what the critics have to say. Also, if you found that ONE wx component the world needs to know about, put it here for future reference.
bwilliams
Knows some wx things
Knows some wx things
Posts: 34
Joined: Mon Dec 19, 2005 3:30 pm

wxWebConnect 1.0 released: web browser library for wxWidgets

Post by bwilliams » Wed Jul 08, 2009 9:29 am

Hello all,

Kirix is pleased to announce the availability of wxWebConnect -- a library for wxWidgets that enables developers to quickly integrate advanced web browser capabilities.

It wraps up functionality exposed by the Mozilla Foundation's Gecko engine (XULRunner) into a set of user-friendly classes to: embed browser controls, search web content, print web pages, interact with the DOM, implement custom content handling for different MIME types, issue POST calls using the current browser state, etc. Notably, with this library you can also embed all of your favorite Firefox browser plug-ins into your application.

With other libraries in the past, embedding a web browser control has proven a daunting task, often involving compiling seemingly countless sub-dependencies. We've gone out of our way to make sure that getting a browser control up and running in your application is as easy as possible.

More information can be found at the wxWebConnect project page (http://www.kirix.com/labs/wxwebconnect.html). A short demo video and some screenshots can be found here (http://www.kirix.com/labs/wxwebconnect/screenshots.html)

We've released the full source code under the wxWindows license, so please go ahead and use this library in your own applications freely.

Comments and criticisms are welcome.

All the best,
Benjamin I. Williams
Kirix Corporation (http://www.kirix.com)

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Wed Jul 08, 2009 3:45 pm

Seems totally awesome! :) This is something wxWidgets definitely needed. Can't wait to try it when I get home.

One thing I couldn't find though, on which platforms was it tested?
"Keyboard not detected. Press F1 to continue"
-- Windows

User avatar
tierra
Site Admin
Site Admin
Posts: 1340
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA
Contact:

Post by tierra » Wed Jul 08, 2009 4:37 pm

Auria wrote:One thing I couldn't find though, on which platforms was it tested?
In the FAQ:
The Mac version compiles, but doesn't currently function. It needs to be tested and debugged, so please let us know if you have Mac expertise and would like to help out. The Linux version compiles and works, but could benefit from more rigorous testing and bug fixes.
And obviously it's been tested and works on Windows.

bwilliams
Knows some wx things
Knows some wx things
Posts: 34
Joined: Mon Dec 19, 2005 3:30 pm

Post by bwilliams » Wed Jul 08, 2009 4:54 pm

Auria wrote:Seems totally awesome! :) This is something wxWidgets definitely needed. Can't wait to try it when I get home.

One thing I couldn't find though, on which platforms was it tested?
It works on Windows and GTK. The Mac version is forthcoming.

All the best,
Ben

yuri
Earned some good credits
Earned some good credits
Posts: 104
Joined: Thu Apr 09, 2009 4:58 pm
Location: Russia

Post by yuri » Thu Jul 09, 2009 2:05 pm

Just one word - FINALLY! :) Crossplatform way to render HTML is long standing issue with WX and it seems like this hole now also plugged. Many thanks!

That said, looking through sources I can't find a way to load HTML from memory (like wxHTML::SetPage). Is it possible to add such method, or better yet, intergate with wxFileSystem or streams? Or is there some other way to do it?

bwilliams
Knows some wx things
Knows some wx things
Posts: 34
Joined: Mon Dec 19, 2005 3:30 pm

Post by bwilliams » Thu Jul 09, 2009 2:57 pm

yuri wrote:That said, looking through sources I can't find a way to load HTML from memory (like wxHTML::SetPage). Is it possible to add such method, or better yet, intergate with wxFileSystem or streams? Or is there some other way to do it?
Right now there isn't a way to display raw html from memory. We tried it, but it seems that in the end the html needs to be written to disk. We then considered the file lifetime issues for the memory html and decided to shelve that feature until the next release.

One idea that we ended up using was to store static runtime html data in a jar/zip file included with the installation. The url scheme looks like this: jar:file:///path/to/file.jar!/about.html

All the best,
Ben

awilliams
Earned a small fee
Earned a small fee
Posts: 12
Joined: Thu Jul 09, 2009 2:48 pm

Post by awilliams » Thu Jul 09, 2009 3:19 pm

For HTML, I would very much like to see such a function.

Two possible approaches:

1. Write out the HTML to a temporary file, then open that URI. If you download the source, you can see an example of this in the sample application (testapp.cpp) in MyFrame::OnGoAbout. The temporary file could then be deleted after loading it.

2. The DOM could be used to create an element, then the text in that element could be set directly using the DOM methods.

Once you have one of these working, a small wrapper function would finish the job.

yuri
Earned some good credits
Earned some good credits
Posts: 104
Joined: Thu Apr 09, 2009 4:58 pm
Location: Russia

Post by yuri » Thu Jul 09, 2009 4:48 pm

bwilliams wrote: One idea that we ended up using was to store static runtime html data in a jar/zip file included with the installation. The url scheme looks like this: jar:file:///path/to/file.jar!/about.html
Ben
That would definitely work for static content, but the point often is to serve dynamic HTML as rezult of user actions.

one also may load some static template and then modify it via DOM, although this is much more complicated.
Another possible way is to loop-serve HTML via HTTP from app itself, as protocol itself is very simple. But then firewall may forbid this (and any sane person too:)

Hope you manage to find a way, and thanks again for a great contribution!

BTW, is there any documentaion planned?

awilliams
Earned a small fee
Earned a small fee
Posts: 12
Joined: Thu Jul 09, 2009 2:48 pm

Post by awilliams » Thu Jul 09, 2009 5:08 pm

For documentation, you can find a reasonable introduction and code examples in the getting started guide, including how to embed the control, set preferences, handle content, and respond to events. You can also find out a list of the classes and functions in the class API.

The class API still needs to have function descriptions filled out. Help is welcome. :)

Best,
Aaron, Kirix

yuri
Earned some good credits
Earned some good credits
Posts: 104
Joined: Thu Apr 09, 2009 4:58 pm
Location: Russia

Post by yuri » Thu Jul 09, 2009 6:36 pm

awilliams wrote:For documentation, you can find a reasonable introduction and code examples in the getting started guide, including how to embed the control, set preferences, handle content, and respond to events. You can also find out a list of the classes and functions in the class API.
Silly me - I expected to find it in dowload zip :)
Having looked it up I think that's OK actually. Great job!

BTW, there is a strange problem with download webconnect-1.0.zip on my Mandriva2009 linux box: instead of dir hierarchy there is flat set of files with '\' (backslash) symbols embedded right into fillenames. On WinXP everything is OK. Could you provide separate version for wxGTK in a form of tgz tarball or pack it some other way?

awilliams
Earned a small fee
Earned a small fee
Posts: 12
Joined: Thu Jul 09, 2009 2:48 pm

Post by awilliams » Thu Jul 09, 2009 7:17 pm

Good idea. You can now download wxWebConnect as a zip or tar archive here.

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Fri Jul 10, 2009 6:46 am

Hi Aaron, hi Ben!

Great, a proper HTML control for wxWidgets!
I'd really like to give it a try, but I do have some problems building it under Linux.

The Makefile references top.mak, which I don't see when untaring the archive. In addition, why do I have to have wxWidgets build in the wxWebConnect directory? I allready have it compiled and installed...

I did try to modify the files, so that top.mak isn't needed and it uses the flags wx-config gives for my system. In fact I managed to compile the lib once, as well as the testapp, but unfortunately nothing shows up when I enter a URL. Do I need something else?

Sorry for bugging you, I didn't really thoroughly try and test it, I merely put together a hackishly solution I thought that would work.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Fri Jul 10, 2009 12:16 pm

Hi!
Ok, did some further testing. I managed to alter the makefiles so that now I don't need a separate wxWidgets installation. Instead I use the version provided by wx-config.

My other problem was, shame on me, that I was missing the correct dir for xulrunner. libxpcom.so never was found, as you didn't include it.
It would be quite cool if wxWebControl (or better the Engine) could check for an installed lib and use that. I simply use an env variable now, pointing to my xulrunner dir.

Works charming now! Thanks for such a great control!
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

bwilliams
Knows some wx things
Knows some wx things
Posts: 34
Joined: Mon Dec 19, 2005 3:30 pm

Post by bwilliams » Fri Jul 10, 2009 10:07 pm

upCASE wrote:Hi!
Ok, did some further testing. I managed to alter the makefiles so that now I don't need a separate wxWidgets installation. Instead I use the version provided by wx-config.
Cool. I'm glad you got it working. Sorry about the Makefiles being messed up-- we'll fix that shortly.

I like the idea of using the system's installed Makefile. By the way, I was really hoping Firefox would follow through with their plan to have a purely xulrunner-based installation. Unfortunately this didn't happen for a variety of technical reasons. It would have been neat to just use the system's firefox installation.

Ben

VonGodric
Earned some good credits
Earned some good credits
Posts: 103
Joined: Sun Jan 30, 2005 9:31 pm
Contact:

Post by VonGodric » Sat Jul 11, 2009 10:16 am

cool and very useful component. Thanks!

However I am having trouble with it as it fails to work. It compiles, but crashes on call to

Code: Select all

wxWebControl::InitEngine(xulrunner_path);
Basically debugger shows that it fails here

Code: Select all

ns_smartptr<nsIWindowCreator> wnd_creator = static_cast<nsIWindowCreator*>(new WindowCreator);
window_watcher->SetWindowCreator(wnd_creator);
in webcontrol.cpp on line 1673

I am using latest TDM's MingW GCC 4.4 (http://www.tdragon.net/recentgcc/) and windows Vista x64

Post Reply