wxWebConnect 1.0 released: web browser library for wxWidgets
wxWebConnect 1.0 released: web browser library for wxWidgets
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)
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)
- tierra
- Site Admin
- Posts: 1355
- Joined: Sun Aug 29, 2004 7:14 pm
- Location: Salt Lake City, Utah, USA
- Contact:
In the FAQ:Auria wrote:One thing I couldn't find though, on which platforms was it tested?
And obviously it's been tested and works on Windows.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.
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?
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.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?
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
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.
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.
That would definitely work for static content, but the point often is to serve dynamic HTML as rezult of user actions.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
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?
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
The class API still needs to have function descriptions filled out. Help is welcome.
Best,
Aaron, Kirix
Silly me - I expected to find it in dowload zipawilliams 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.
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?
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.
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
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
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!
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
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
Cool. I'm glad you got it working. Sorry about the Makefiles being messed up-- we'll fix that shortly.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.
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
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
Basically debugger shows that it fails herein webcontrol.cpp on line 1673
I am using latest TDM's MingW GCC 4.4 (http://www.tdragon.net/recentgcc/) and windows Vista x64
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);
Code: Select all
ns_smartptr<nsIWindowCreator> wnd_creator = static_cast<nsIWindowCreator*>(new WindowCreator);
window_watcher->SetWindowCreator(wnd_creator);
I am using latest TDM's MingW GCC 4.4 (http://www.tdragon.net/recentgcc/) and windows Vista x64