Code Reuse and Multiple Toolkits
The fact of the matter is that there will always be more than one toolkit
for Unix. Right now the big players include Motif, GTK+ and QT.
Each of these toolkits unfortunately has its own look and feel for many
things including menus and scrollbars.. None of these toolkits is
going away anytime soon and it is inevitable that there will be ports of
mozilla to each of these toolkits.
Some of the toolkit will be done inside of Netscape and donated to the
mozilla project and some will be done by the mozilla.org community.
However, each new toolkit burdens the dedicated individuals who want to
maintain the sanity of The Project. Even more troubling is the amount
of duplicated code that will be in each of the toolkit ports and will have
to maintained.
One of the goals of the Xlib toolkit project is to create a common base,
written in Xlib, that will include all of the functionality that is common
across the Unix toolkits. The majority of the code will include simple
drawing and image handling in the gfx module. It will also include
some of the widget side of the toolkit. Some candidates include the
nsWindow class which is the simple drawing surface used by the html layout
and the XP widgets.
One of the project goals should be to make it very easy to plug in your
toolkit of choice. This means that you will be able to use Mozilla
in your Motif, GTK+ or QT application. Until the world chooses the
One True Toolkit or dies in the process, Mozilla should be able to run
on all the toolkits without hardship to people writing applications.
Stand alone Browser
It should also be possible to have a stand alone Mozilla browser that
is based entirely in Xlib. While this compromises one of the
primary goals of the many Desktop Projects for Unix and Unix-like systems,
it allows for a lightweight browser implementation that could be used on
a Kiosk system, or on very old hardware. The fact is that Mozilla
contains most of the functionality of the modern Unix widget toolkits and
it is a very small stretch to turn it into a complete toolkit system.
Internationalization
Not all toolkits are created equal. Right now the only
toolkit with good International support is Motif. The next
versions of both QT and GTK+ promise to include Unicode support
but neither of those are available now and Mozilla should still target
the widest audience possible. This includes using current
versions of the toolkits instead of bleeding edge versions. In
Xlib it is possible to do internationalization without the support of
the toolkit and much of the infrastructure for that is already in
place.
A Look to The Future
Past the initial 5.0 release, it has been made clear that mozilla will
probably be moving to an almost entirely gfx based widget system. The
reason for this is that there are many part of XUL and HTML 4.0 and
CSS that require widgets are capable of functionality that normal
toolkits don't encompass. An example of this would be transparency
of text fields which none of the toolkits currently do.
An Xlib based mozilla would allow all of the toolkits in question to
take advantage of this without any changes. Also, at what point do
you want to keep using a toolkit if you only need it for scrollbars and
menus?