Help Surfer

I was up to 4.00 am working on this, then got up at 10.00am -- don't like to skew my sleep pattern like this. Anyway, was working on something interesting, didn't want to stop...

I mentioned recently that I compiled Osmo with the libgtkhtml dependency:
http://bkhome.org/blog/?viewDetailed=01580

Yesterday I was hunting around for a simple example of a HTML viewer using libgtkhtml. It is surprising how little example code there is. There is another project, 'gtkhtml', which needs Gnome libraries. libgtkhtml appears to be a pure GTK library that is extracted from 'gtkhtml' -- I found some example code for gtkhtml but it would need considerable hacking to get to work with libgtkhtml. The libgtkhtml source package does have an example but I found it very obscure.

FedoraOS
Anyway, I found something. There is a simple web browser named Surfer, part of DeforaOS:
http://www.defora.org/

The main developer is Pierre Pronchery. It is a complete operating system, with bootable CD, based on Gnu C and GTK.

Surfer
This is a tiny web browser. A fascinating feature is that it can be configured to use either libgtkhtml, gtkmozembed or webkit. Gtkmozembed is out, now that we have upgraded to SeaMonkey 2.x (and FF 3.6), webkit is very big.

libgtkhtml is very limited, plain HTML only. No CSS, DOM or Javascript. In fact, I tried it (Surfer compiled with libgtkhtml) with my /usr/share/doc/index.html page which has a little bit of Javascript in it, and it hung -- wasn't even nice enough to ignore the Javascript components.

My primary motivation is to display /usr/share/doc/welcome1stboot.htm -- incidentally, Abiword 2.8.3 does a lousy job of it. For Quirky 1.1 I used Gview to display it as a PNG image. Now this is interesting -- my Surfer PET is 99KB, the PNG that is no longer needed is 49KB, so I'm getting a simple HTML viewer for almost nothing -- of course that supposes that libgtkhtml is already there (PET is 186KB).

Compiling Surfer
I used Surfer 0.0.7, which is not the latest. The latest version supports tabs and spell-checking -- but the latter did not work. The latest also has an extra dependency, 'libDesktop'. Version 0.0.7 has two dependencies, 'gnet' and 'libSystem':
http://live.gnome.org/GNetLibrary
http://ftp.gnome.org/pub/GNOME/sources/gnet/2.0/
http://www.defora.org/os/project/display/27/libSystem

I also found the URL-entry box is buggy. As I only want this to be called from other applications to display simple help files, I decided to remove the menu and and URL-entry box, leaving just back, forward, refresh and stop buttons. No text search, it would be nice if that could be implemented.
I had to hack it somewhat, as it is setup to use Webkit. Here is my hacked source 'Surfer-0.0.7-patched_libgtkhtml_embedded.tar.gz':
http://bkhome.org/sources/alphabetical/S/
(user: pu#pp#y password: li#nu#x)

Surfer also supports SSL and file downloading, even my cutdown version. If that was taken out, the PET could be made even smaller. It would be unwise to venture onto the Internet with this libgtkhtml-based Surfer, so those features are redundant. Though, help pages with links to download files such as PETs, might be useful.

Surfer 0.0.7 (hacked) will be in Quirky 1.2. I modified /usr/sbin/delayedrun to detect if executable 'surfer' exists then use that to launch 'welcome1stboot.htm'. I removed 'welcome1stboot.png'.

Here is my Surfer PET (gnet and libSystem libraries included in the PET):
http://distro.ibiblio.org/pub/linux/distributions/quirky/pet_packages-quirky/helpsurfer-0.0.7-q1.pet

libgtkhtml
If you want the source:
http://ftp.acc.umu.se/pub/GNOME/sources/libgtkhtml/2.11/
Documentation? -- there doesn't seem to be any, not even on the official GTK and Gnome documentation sites.

Web
As I was looking around just prior to making this post, I discovered this:
http://chrislord.net/blog/Software/Web/
...interesting! He has added Javascript support, via Spidermonkey.


Posted on 23 May 2010, 12:07


Comments:

Posted on 23 May 2010, 12:25 by BarryK
Helpsurfer project
It would be an interesting project for someone, to hack Surfer further, so that it is purely an internal HTML help file viewer. Take out all the Internet parts, such as SSL and whatever 'gnet' does. Remove the downloader.

In fact, block Internet access entirely -- for any Internet links, launch the full browser 'defaultbrowser'. Ditto, introduce simple mime handling to launch appropriate app for any links to internal text or PDF files.

A text-search would also be nice.



Posted on 23 May 2010, 12:41 by BarryK
gtkhtml api reference
This is the best I can find:

http://www.fifi.org/doc/libgtkhtml-dev/html/gtkhtml.html

...it is for the gtkhtml package, but as the libgtkhtml package seems to be derived from it, the above reference is probably valid.



Posted on 23 May 2010, 13:58 by ttuuxxxx
gtkhtml
Hi Barry isn't the latest Gtkhtml V3 better?
http://ftp.gnome.org/pub/GNOME/sources/gtkhtml/3.31/gtkhtml-3.31.1.tar.gz
also this is a guide on using it
http://primates.ximian.com/~rodo/programing_with_gtkhtml_tutorial/guadec.html
Then there's evolution which uses it http://projects.gnome.org/evolution/download.shtml
Not sure if its the same,
ttuuxxx



Posted on 23 May 2010, 15:00 by BarryK
Gtkhtml3
Yeah maybe, but the gtkhtml package needs gnome libs. That's probably why someone pulled out libgtkhtml as a separate package.



Posted on 23 May 2010, 17:28 by Tony
Wallpaper
Hi Barry, just a thought but if you just want to display this information could it not be the wallpaper on first boot?
Love Quirky!
Cheers
Tony


Posted on 26 May 2010, 19:43 by f00-
man2html etc
Yep, tried surfer in w020 (with added libgtkhtml) and it does a splendid job - also 'doubles' as a filebrowser (although that may be perhaps unintentional) if it tries #<internalpagelink> in the url it goes 'up' from the page to parent dir. Great as a SendTo/OpenWith in rox for local pages, text and so on. If local help resources are proper for man2html, surfer should be the goto app :) (no more waiting for SM to load unless it really *needs* an online page or website)


Posted on 27 May 2010, 10:08 by BarryK
Info in wallpaper
Tony,
There was once an official release of Puppy that did exactly that. The problem though, I think that it had to be manually created. Also, the image is big, as big as the Surfer package -- so there isn't much point, might as well use Surfer.