As usual it’s 2 ‘O clock at night and I’m still coding tinymail. I know this isn’t good. I’m fearing I’m a little bit addicted to coding. That’s nothing new of course. Maybe I shouldn’t blog at 2’O anymore, saves me a discussion about it with Tinne.
Anyway. I reimplemented the HTML messages support using Gecko in tinymail. It used to be quick ‘n dirty with temporary files and all that crap. Back then because I didn’t really have a lot time to figure out all the (mostly hidden) GtkMozEmbed API details. Nothing about time changed. It just finally got at the top of my todo items.
I replaced this with the nicer stream API of GtkMozEmbed. I also implemented not loading images and stuff like that. Of course you don’t want a HTML component to load images. Spammers would have an easy time figuring out whether or not your E-mail account is being read by somebody like you. Same for (Java) scripts.
Yet I’m interested in displaying images that tinymail has in its memory. Like as MIME part attached images. If the HTML components gives me a callback like: “draw the image that has this unique URL on this drawing area”, I could of course implement this. With GtkHTML I know something like this is possible. Tinymail is a framework that allows to implement multiple types of a (the functional same) mime part viewer. Note that a GtkHTML version of the TnyMsgView interface is implemented by Dirk-Jan and waiting for both cleaning up and licensing issues to go in the tinymail repository as LGPL. Webkit, GtkWebCore and Kit, WhateverKit they are all planned and possible, yes.
Again, the idea here is flexibility. If the vendor of the device already decided to use Gecko for all the HTML stuff, then what is little tinymail to contest that decision? The vendor wont, I repeat, he wont change that decision. That’s why these interfaces exists: you’ll use one of the default implementations, you’ll inherit and enhance one of the existing ones or you’ll implement it yourself. A good example: maybe the OLPC team wants to implement a mime part viewer as a web page or web page component? Sure! Possible. Because they don’t have to inherit from some Gtk+ type: they can implement from scratch without using any technology that they don’t need.
The TnyMozEmbedHtmlMimePartView is one such implementation of the TnyMimePartView interface. It also inherits GtkMozEmbed because, well, that’s what it is. It’s nature is indeed to be a GtkMozEmbed instance. Interface oriented development isn’t hard or more complex. In fact it makes things much more simple and straight forward. It avoids silly multiple inheritance.
Hmm, I should go to bed now.