Thursday, January 21, 2010

KOffice - Portability in Action

I have on several occasions been asked "why do you work on KOffice when OpenOffice.org already exists and does everything people need?". Well, there are several reasons why OpenOffice.org (OOo) is not the end-all of free office suites. This blog is the first in a series that will outline why KOffice is necessary and why it may in fact be the real future of the free office suites.

Let's start in this blog with portability.

KOffice runs on all Linux distributions which is not surprising since most of it is developed on Linux. It also runs on Windows and MacOS X, although these ports are not production ready yet. There is still some infrastructure and packaging work to do, but the KDE Windows and MacOS X teams are doing a fine job there. These three platforms are also the ones that are supported by OOo.

But it doesn't end there. Three days ago, a KOffice port to Haiku, the free followup of BeOS, was announced. The porting team had started out by porting Qt, the great C++ toolkit from Trolltech, now owned by Nokia. After that they continued with the KDE libraries and then KOffice and most other KDE applications were just a simple matter of compiling. There is also a port of KOffice to FreeBSD, which is another Unix dialect where, to my knowledge, OOo doesn't work. Edit: OOo is available on FreeBSD as shown by one of the comments, my bad.

KOffice on Haiku

But to make things really interesting, we have to look at the mobile devices. This week we saw the first alpha release of the office viewers on the Nokia N900 device. This release is interesting in several ways. First of all, it's not a normal Intel processor and not a normal desktop or laptop machine with all the power and memory that such a machine has access to. Instead it's an embedded device and demands a very low energy consumption but still needs to provide a fast response to the user.


The office viewer on the Nokia N900 with its custom UI.

The other challenge with the N900 port was that the UI had to be switched for a new one. The desktop version of KOffice uses the normal WIMP interface (Windows, Icons, Menus, Pointers) but the N900 device has a touch screen and a small form factor. The desktop UI would simply not be workable for such a device. KOffice is the only free office suite that allows the developer to use the internal engine for loading and rendering the contents and create a custom UI on top of it.

So, what gives KOffice this great flexibility and portability? Well, first of all it's the Qt toolkit. Qt is arguably the most portable toolkit of all, and especially if you take into account that it provides a native look&feel on all platforms that it is ported to. Qt is ported to all Unix dialects, Windows, Mac, Symbian and many more. On X windows it can even take on the look of the desktop environment, like Gnome or KDE Plasma.

Second, it's the design of KOffice itself. KOffice has a very modular design. Not only is the GUI mostly separated from the engine, it's also very much based on plugins. In some cases even plugins have plugins -- the spell checker, for instance, is a plugin to the text shape, which is a plugin in itself.

The first point makes it possible for the developer to create completely new UI like Nokia did. We foresee KOffice ported to Symbian and other mobile OS'es like Moblin and Android once Google allows native applications that are not written in Java on it. And why not a port to Windows Mobile?

The modular design with plugins makes it very simple to create a tailored version of KOffice with a selected set of features. Right now, there is a CMake option to the configuration phase called "TINY" that creates a smaller KOffice with a limited set of applications and a limited set of filters and built-in shapes. As far as I know, there is no similar build time options to OOo or Abiword. It's also easy to replace functionality by simply switching a plugin to something similar. An example of this is how Thomas Zander created a simplified text formatting docker for kids with fewer options and bigger buttons.

So, the combination of these two makes KOffice uniquely suited for non-standard platforms. Non-standard by desktop standards, that is. Most people today agree that mobile is the future. And maybe so is KOffice...

9 Comments:

Blogger maninalift said...

This is really, really fabulous. It must be great to see all that hard work bearing fruit in the form of demonstrated flexibility and portability.

Been interested in Haiku for some time but it looked like a bit of a barren place. No more.

3:29 AM  
Blogger 2ben said...

The only worries I have are regarding the documents. I seem to remember that OOo doesn't exactly follows the ODF specs, or that parts of the ODF are subject to interpretation, which can lead to differences of rendering between, for example, OOo and KOffice.
My company is 100% OOo, and we have years of documents all in odt/ods/odp, and we for sure would find it hard to switch if it means broken files...
So the question is, will KOffice emulate OOo, 1 for 1 down to the eventual bug, or will it do it its way, and make differences ?

4:42 AM  
Blogger mikmach said...

Unfortunately Qt text rendering engine still has problems with kerning. I don't understand why it is visible in KOffice while on Web text usually looks OK or at least it is not outstanding as in KOffice. Small mismatches you can even see on screenshot from text.

5:16 AM  
Blogger Alex Wauck said...

OpenOffice is available for FreeBSD:
http://www.freebsd.org/cgi/cvsweb.cgi/ports/editors/openoffice.org-3/

6:34 AM  
Blogger ingwa said...

@2ben: Interoperability is one of our top goals. When the standard is open to interpretation, we tend to follow the OOo way. When OOo actually doesn't follow the standard at all, it's a more difficult call...

@Alex: fixed.

6:44 AM  
Blogger Drew said...

"...especially if you take into account that it provides a native look&feel on all platforms that it is ported to."

If KOffice, or rather Qt, were to look native in Gnome I think that would be a show-changer.

There are aspects of KOffice I like over OpenOffice, but I am not in KDE nearly as much as Gnome and I haven't liked the way Qt/KDE apps look in Gnome in the past.

8:47 AM  
Blogger Warbo said...

I'd like to point out that OpenOffice.org will run on the ARM-based OpenMoko by apt-getting it in Debian (screenshot http://wiki.openmoko.org/wiki/Image:Freerunner_Debian_runs_openoffice3.jpg ), although it uses the same UI as the desktop and is thus pretty useless on such a form-factor ;)

I completely agree that OOo isn't *the* FOSS office suite, and much prefer a "whatever works for you" attitude. Personally I do all of my writing (mainly scientific) in Lyx which is also based on Qt, or plain old KWrite if I don't care about formatting. Abiword is nice too, but these days I don't tend to write anything that needs more than plaintext but less than LaTeX. Gnumeric is a far superior spreadsheet to OOo Calc though, which I discourage people from using since being bitten by it (eg. error bars in v2 *shudder*). I admit I haven't used KOffice since the start of the rewrite when it was very buggy and incomplete, so I'll give it another go :)

PS: I've tried Haiku and I like it, although I was never a BeOS user so I don't get any warm fuzzy feeling from it like I'm sure its devs do. AROS on the other hand...

8:48 AM  
Blogger Aaron J. Seigo said...

really well written entry that captures a number of the key points about KOffice that help make it truly one of the f/oss projects to watch.

one small personal quibble: i don't think mobile is the future; i think it's a new part of the future. it wasn't clear how big role it would play, say, 15 or 20 years ago. today it's much more clear, but even then, as with all technologies (think newspaper -> radio -> television -> internet) new comers tend to displace rather than outright replace (with some notable exceptions of the latter having occurred, of course).

this is important, i believe, because it can be tempting to jump to such a strong focus on mobile that we forget all the other device form factors out there, from the traditional laptop/desktop to other new concepts like "smart" televisions.

i don't think koffice is doing this in the least, and really think the direction you folks are going is very commendable and represents a solid strategy. (not that you need _me_ telling you that! :)

hopefully others will follow suit as applicable over time, and without over-focusing on mobile form factors. :)

@Drew: as of Qt 4.5 there is support to render all the Qt widgets using the active Gtk+ widget style and color palette. it doesn't stop there, however: buttons in dialogs (ok / cancel, etc) swap positions automatically to match the "local" HIG (KDE, GNOME, Mac, Windows) and there are various other similar touches here and there throughout.

it's not 100% perfect (the entire UI isn't completely rewritten on the fly :) but the presentation is more than good enough to make the toolkit choice irrelevant for all but the most picky.

this is one of the strengths of Qt (and by extension KDE): we're all about platform independence and new plateaus have been achieved towards that end in just the last year or two. :)

1:35 PM  
Blogger nazia shah said...

your blog is very nice and very informative, i really like it and i find it very helpful, actually i am visiting on first time to this blog but i really like it and i find it very interesting, i am going to share it on my fb with my friends,
Latest mobile

4:46 AM  

Post a Comment

<< Home