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:
http://bkhome.org/archive/blog2/201005/osmo-0210.html

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.

Comments

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"114.129.167.148'gtkhtml api reference"BarryK"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. Username: 23 May 2010, 12:41
"01608"114.129.167.148'gtkhtml"ttuuxxxx"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 Username: 23 May 2010, 13:58
"01608"123.243.198.100'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"114.129.167.148'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"92.26.149.74'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"172.162.180.62'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
"01608"114.129.167.148'

Tags: quirky