The GNOME Project

What is GNOME and where is it heading? Miguel tells us all.
Dissecting a GNOME Desktop Application

The toolkit

GNOME desktop applications have been built on top of the object-oriented GTK+ toolkit originally designed as a GUI toolkit for the GNU Image Manipulation Program (GIMP).

GTK+ has been implemented on top of a simple window and drawing API called Gdk (GTK Drawing Kit). The initial version of Gdk was a fairly thin wrapper around the Xlib libraries, but a port to Win32 and a port to the Y windowing system are presently in alpha stages.

GTK+ implements an object system entirely in C. This object system is quite rich in functionality, including classical single inheritance, dynamic creation of new methods and classes, and a “signal” mechanism for dynamically attaching handlers to the various events that occur in the user interface. One of GTK's great strengths is the availability of a wide range of language bindings, including C++, Objective-C, Perl, Python, Scheme and Tom. These language bindings provide access both to GTK+ objects and to new objects programmed in the language of choice.

An additional feature of GNOME is Rasterman's Imlib library. This library is implemented alongside Gdk and provides a fast yet flexible interface for loading and saving images and rendering them on the screen. Applications using Imlib have quick and direct access to PNG, GIF, TIFF, JPEG and XPM files as well as other formats available through external conversion filters.

The Support Libraries

C-based GNOME applications use the GLIB utility library. glib provides the C programmer with a set of useful data structures: linked lists, doubly linked lists, hash tables (one-to-one maps), trees, string manipulation, memory-chunk reuse, debugging macros, assertion and logging facilities. glib also includes a portable interface for a dynamic module facility.

The GNOME libraries

The GNOME libraries add the missing pieces to the toolkit to create full applications, dictate some policy, and help in the process of providing consistent user interfaces as well as localizing the GNOME applications so they can be used in various countries.

The current GNOME libraries are GTK+-Xmhtml, gnome-print, libgnome, libgnomeui, libgnorba, libgtop, gnome-dom and gnome-xml. Other libraries are used for specific applications: libPropList (soon to be replaced by a new configuration engine) and audiofile.

The main non-graphical library is called libgnome. This provides functions to keep track of recently used documents, configuration information, metadata handling (see below), game score functions and command-line argument handling. This library does not depend on the use of a windowing system.

As we use CORBA to achieve parts of our desktop integration, we have a special library called the libgnorba library to deal with various CORBA issues. It provides GUI/CORBA integration (to let our GUI applications act as servers), authentication within the GNOME framework and service activation.

The gnomeui library, on the other hand, has the code that requires a window system to run. It contains the following components:

  • The GNOME session management support

  • Widgets, both as straightforward extensions of GTK+ and designed to be dependent on libgnome features

  • A set of standard dialog boxes otherwise not available on GTK+, well-integrated with other GNOME libraries

  • Standard property configuration dialog boxes

  • Standard top-level window handling

  • A multi-document interface (gnome-mdi)

  • Windowing hints

  • CORBA integration where required

GTK+-XmHTML is a port of the Koen D'Hondt's XmHTML widget for Motif and is used for our HTML display needs. Our changes are being folded back into the main distribution.

The lib gtop library allows system applications to be easily ported to various operating systems; it provides system, process and file system information.

gnome-xml provides XML file loading, parsing and saving for GNOME applications and is being used in the GNOME spreadsheet (Gnumeric) and in the GNOME word processor program. gnome-dom provides an implementation of the World Wide Web Consortium's Document Object Model for GNOME applications. By the time you read this article, gnome-dom will have been deployed widely in the GNOME office applications. Both gnome-xml and gnome-dom were developed by Daniel Veillard from the World Wide Web Consortium.

Figure 5

gnome-print implements GNOME's printing architecture. It consists of a pluggable rendering engine as well as a set of widgets and standard dialog boxes for selecting and configuring printers. In addition, gnome-print is responsible for managing outline fonts and contains scripts that automatically find fonts already installed on the system.

The GNOME print imaging model is modeled after PostScript. Basic operations include vector and bezier path construction, stroking, filling, clipping, text (using Type1 fonts, with TrueType to follow shortly) and images.

Currently, gnome-print generates only PostScript output. However, the design of the imaging model is closely synchronized with the anti-aliased rendering engine for the Canvas and it is expected that these two modules will be interoperating soon. In particular, it will be possible to “print” into a canvas (useful for providing a high-quality screen preview) and to print the contents of a canvas. This feature should simplify the design of applications which use the Canvas, as very little extra code will be needed to support printing.

The same rendering engine will be used to render printed pages directly without going through a PostScript step. This path is especially exciting for providing high-quality, high-performance printing to color ink-jet printers, even of complex pages containing transparency, gradients and other elements considered “tricky” in the traditional PostScript imaging model.

Bindings

One explicit goal of GNOME was to support development in a wide range of languages, because no single language is ideal for every application. To this end, bindings for both GTK+ and the GNOME libraries exist for many popular programming languages, currently C, C++, Objective-C, Perl, Python, Scheme and Tom.

The early involvement of Scheme, Tom and Perl hackers in both the GTK+ and GNOME projects has helped in making the GTK+ and GNOME APIs easy to wrap up for various languages. Multi-language support is “baked in” to the design of GTK+ and GNOME, rather than being added on as an afterthought.

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState