Bailey O.H.Embedded systems.Desktop integration.2005
.pdf
120 |
Chapter 5 / Developing the Desktop User Application |
|
|
Figure 5-4: Windows version
The above application is a simple web page viewer and list display running on Windows. It looks like a standard Windows application. While it doesn’t have a menu bar, it does have a standard Windows toolbar and tool buttons.
The following figure is the Linux version of this same program.
Figure 5-5: Linux version
Chapter 5 / Developing the Desktop User Application |
121 |
|
|
Figure 5-5 shows a different web page being displayed than the one shown in Figure 5-4, but the same toolbar, tool buttons, list box, and page display are evident. The Linux display is running under the GNOME desktop manager.
Figure 5-6
Figure 5-6 shows a screen shot of DialogBlocks, a design program for the wxWindows framework. It is very similar to other design tools, offering a visual designer and code access to include files, code files, variables, and event handlers for the current object being designed.
Zinc Interface Library
The Zinc library has been around for almost 15 years. Originally developed by Zinc Software, the product supports UNIX, DOS, and Windows. In the early days you could select a text or graphic mode DOS interface. Over the years Zinc has changed hands several times. Today the Zinc product is owned by Wind River and is
Chapter 5
122 |
Chapter 5 / Developing the Desktop User Application |
|
|
available in an embedded version or the legacy Windows and UNIX versions. The UNIX and Windows versions are available under the GPL license scheme. Two versions are currently supported — version 5.3 and version 6. Version 6 is for Wind River customers who wish to embed Zinc. The library includes the Zinc Designer, which allows you to build the interface and then compile it for one or more targets. The Zinc interface toolkit, like Qt and wxWindows, resides in user memory.
Figure 5-7
Zinc does differ from wxWindows and Qt in several ways. First, the Zinc library started as a commercial product and went through several generations before becoming open source. As a result, Zinc matured before being released to the open-source community and has thorough documentation. Next, Zinc has been ported to several embedded platforms and supports several embedded operating systems. Both Qt and wxWindows can be embedded, but Zinc has supported embedded systems longer. And last, Zinc is owned by Wind River, a company that specializes in embedded tools.
Chapter 5 / Developing the Desktop User Application |
123 |
|
|
Following is a screen shot of the Zinc Designer running on Windows XP.
Figure 5-8
For those of you who may have used Delphi, Visual C++, or another visual development tool, the Zinc Designer will look somewhat familiar. The window in the center is what the end product will look like. The visual designer is the tabbed bar at the top right. The top window on the left is a list of components that have been inserted into the main window. The lower window on the left contains the properties of the currently highlighted object, which in this case is the Exit button.
Chapter 5
124 |
Chapter 5 / Developing the Desktop User Application |
|
|
GTK+
The GTK+ library is tightly coupled to the GNOME desktop manager. Originally started as a means of distributing networkable application objects on Linux and UNIX, GTK+ is the foundation of the graphics manager and user interface components. The complete system includes libraries, applications, and a visual designer. GNU C++ and Microsoft C++ are supported as the compilers to build the GTK+ environment, but many languages are supported for development. GTK+ is available for Linux, UNIX, and Windows 32-bit mode. There is also a Cygwin version available, which means there are two choices of implementation for the Windows platform. GTK+ is a part of the GNU software project, so it is free to use and distribute. GTK+ is a complete product, which is demonstrated by the following screen shot of AbiWord, a word processor written using GTK+.
Figure 5-9
Chapter 5 / Developing the Desktop User Application |
125 |
|
|
As you can see from the word processor application, GTK+ is a very complete toolkit. All of the standard edit controls are available to the developer including menus, toolbars, and document interfaces. The following screen shot shows the same program running on Linux.
Figure 5-10
Aside from the distinctive GNOME look, both applications look and function the same.
Comparing GTK+, Qt, wxWindows, and Zinc
On the surface, these four products seem to be almost identical. They all support the platforms required in our project. Each library either includes a visual designer or has third-party support that provides visual design tools, and all of these libraries have open-source versions. But if we look a little closer we find some important differences.
Chapter 5
126 |
Chapter 5 / Developing the Desktop User Application |
|
|
While it is true all of these libraries have open-source versions, three of these products have no commercial version available. wxWindows is a completely free product that is open source. The Zinc framework is also completely open source for version 5.3. Zinc does offer a commercial product for embedded developers. The Zinc framework includes everything necessary to install, compile, and visually design an application from start to finish on Windows and several UNIX and Linux platforms. The Zinc framework also includes PDF versions of the installation, quick start, and reference manuals. These are updated versions of manuals that shipped to customers who purchased this product. Zinc supports Linux, Windows, Sun Solaris, Hewlett Packard, SCO UNIX, and XENIX. GTK+ is also open source and has no commercial equivalent. Used as a core portion of the GNOME desktop and supported by the GNU Free Software Foundation, GTK+ is both widely used and well supported.
wxWindows is a very popular and refined product. Like the Zinc framework, wxWindows is covered by open-source licensing only, which means there are never any royalties for use. Unlike Zinc, however, wxWindows has no visual designer included. While that is technically true, the preferred designer shown in Figure 5-11 (DialogBlocks) was written by one of the committee members of the wxWindows team.
Figure 5-11
Chapter 5 / Developing the Desktop User Application |
127 |
|
|
wxWindows is a mature product with plenty of support from third parties. The Borland C++BuilderX product provides a technology preview of a visual designer that uses the wxWindows framework. In addition, wxWindows is available on the Apple Macintosh. The Zinc interface library was never ported to the Mac, instead going in the direction of embedded systems. If Apple support is required, then you are faced with either wxWindows or the Qt library.
Now we come to Qt from Trolltech. Qt is unique in that a free noncommercial version is available for Linux but not for Windows. This means that Qt is only available as a cross-platform solution as a commercial product. The Qt library is not cheap — the Professional version starts at more than $1,500 per developer and the Enterprise version starts at over $2,500 per developer for a single platform. A multiplatform product is even more expensive. (Check with Trolltech for current pricing.) The reason for the Linux-only noncommercial version is due at least in part to the KDE desktop using Qt as its delivery framework. Qt is also included in Delphi 7, Kylix 1, 2, and 3, and C++Builder 6 and later as the foundation of the CLX visual component library provided by Borland.
Another concern with using Qt is the conditions under which you move from a noncommercial to commercial license arrangement. In short, once you begin selling your product you no longer qualify for a noncommercial license. If you sell your first program for $59, you could end up spending almost 50 times that amount immediately to legally use the Qt product. Finally, if you want support for Linux, Windows, and the Apple Macintosh, prepare for a big dent in your wallet. Pricing for multiplatform support starts at more than $3,000 per developer for the Professional version.
Chapter 5
128 |
Chapter 5 / Developing the Desktop User Application |
|
|
GTK+, Qt, wxWindows, and Zinc Interface Library Summary
The following table summarizes these products so we can determine how viable they are for our needs.
Table 5-1: Comparing libraries
Product |
Windows |
Linux/UNIX |
Macintosh |
License |
Visual |
Source |
Price |
|
|
|
|
|
Designer |
Code |
|
|
|
|
|
|
|
|
|
GTK+ |
X |
X |
1 |
GNU |
Yes |
Yes |
$0 |
|
|
|
|
|
|
|
|
Qt |
X |
X |
X |
2 |
Yes; |
3 |
<$5 K4 |
|
|
|
|
|
included |
|
|
wxWindows |
X |
X |
X |
GPL |
Third |
Yes; |
$0 |
|
|
|
|
|
parties |
included |
|
Zinc |
X |
X |
No |
5 |
Yes; |
Yes; |
$0 |
|
|
|
|
|
included |
included |
|
|
|
|
|
|
|
|
|
Notes:
1.I have not found a Macintosh version of GTK+ but there may be support directly or through a version of GNOME for the Mac.
2.Noncommercial and commercial licensing
3.Noncommercial Linux only; commercial all
4.Price per developer
5.The license enclosed with Zinc is from the commercial product days. It is undetermined if Zinc follows GPL or GNU licensing. As of this writing, Zinc has not returned my inquiries to clarify this issue.
From the information obtained it would appear that Qt is aimed at the corporate developer. For commercial product development, either wxWindows or Zinc would prove to be a more cost-effec- tive choice. In the end, however, I would choose wxWindows over Zinc. The reason is support. While both products include source code, there are two issues with the Zinc library: The first is licensing. Wind River has not updated the license to reflect that it is now an open-source product. While this is probably not to the disadvantage of the user, it could still present problems. More important, however, is the fact that development on desktop versions of Zinc seems to have stopped. This leaves it to the user of this product to maintain it and enhance it. That could easily erase any cost savings that using the library would bring. If
Chapter 5 / Developing the Desktop User Application |
129 |
|
|
we choose to use a library, we have several good options available to us.
The .NET Framework
The .NET (pronounced “dot-net”) framework is in a different classification from the above libraries. Instead of being linked to the application during the compilation process, .NET takes a different approach. In the previous chapter we briefly looked at the
.NET definition. Now we will see if .NET should be considered for our user application development piece. There are several efforts underway to implement the .NET specification on several platforms. The most functional and recognized to date is the Microsoft implementation. While Microsoft is involved as a participant in defining the .NET architecture, there are others involved as well. In addition, the .NET architecture has been approved as a standard in Europe and the UK. The .NET specification defines the software equivalent of an electrical outlet and plug. Software developed for .NET is not compiled to native machine code but rather to an intermediate code that is tokenized. In order for this code to work, the .NET framework has to be installed on the target machine. Once installed, a program compiled to the intermediate language can be loaded and executed. Once loaded, the program is converted to machine language for the machine it is running on and then executed. This feature in and of itself isn’t so remarkable since CPM BASIC was tokenized 26 years ago. But a compiled .NET program isn’t just tokenized. The intermediate language file can be loaded on any
.NET framework on any computer. This means the same program not only runs on Windows, but the same program image can be installed and run on Windows, Linux, UNIX, even IBM mainframes.
In the .NET environment, the user application is compiled to machine code after the program is loaded. The .NET framework becomes a part of the operating system and translates calls to the
Chapter 5
