site  contact  subhomenews

Help Surfer

May 23, 2010 — BarryK
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:

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.

Anyway, I found something. There is a simple web browser named Surfer, part of DeforaOS:

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

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':

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':
(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):

If you want the source:
Documentation? -- there doesn't seem to be any, not even on the official GTK and Gnome documentation sites.

As I was looking around just prior to making this post, I discovered this:
...interesting! He has added Javascript support, via Spidermonkey.


Helpsurfer project
Username: BarryK
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. Username: 23 May 2010, 12:25
"01608"'gtkhtml api reference"BarryK"This is the best I can find: is for the gtkhtml package, but as the libgtkhtml package seems to be derived from it, the above reference is probably valid. Username: 23 May 2010, 12:41
"01608"'gtkhtml"ttuuxxxx"Hi Barry isn't the latest Gtkhtml V3 better? also this is a guide on using it Then there's evolution which uses it Not sure if its the same, ttuuxxx Username: 23 May 2010, 13:58
"01608"'Gtkhtml3"BarryK"Yeah maybe, but the gtkhtml package needs gnome libs. That's probably why someone pulled out libgtkhtml as a separate package. Username: 23 May 2010, 15:00
"01608"'Wallpaper"Tony"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"23 May 2010, 17:28"01608"'man2html etc"f00-"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)"26 May 2010, 19:43"01608"'Info in wallpaper"BarryK"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. Username: 27 May 2010, 10:08

Tags: quirky