]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/gtk/wxGNOME/wxGNOME.html
Use C locale representation for floating point numbers in wxAny.
[wxWidgets.git] / docs / gtk / wxGNOME / wxGNOME.html
... / ...
CommitLineData
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<HTML>
3<HEAD>
4 <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-15">
5 <TITLE></TITLE>
6 <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.0 (Linux)">
7 <META NAME="CREATED" CONTENT="20041114;15091400">
8 <META NAME="CHANGED" CONTENT="20041114;22531000">
9</HEAD>
10<BODY LANG="de-DE" DIR="LTR">
11<H1 ALIGN=CENTER>Whitepaper: wxWidgets on the GNOME desktop</H1>
12<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Introduction</FONT></FONT></P>
13<P>wxWidgets<A HREF="http://www.wxwidgets.org/"><SUP>[1]</SUP></A>
14(formely known as wxWindows) is a C++ cross-platform GUI library,
15whose distintive feature is the use of native calls and native
16widgets on the respective platform, i.e. an application compiled for
17the Linux platform will use the GTK+<A HREF="http://www.gtk.org/"><SUP>[2]</SUP></A>
18library for displaying the various widgets. There is also a version
19(&bdquo;port&ldquo;) of wxWidgets which uses the Motif toolkit for
20displaying its widgets (this port is commonly referred to as wxMotif)
21and another one, which only uses X11 calls and which draws its
22widgets entirely itself, without using any outside library. This port
23is called wxX11 or sometimes more generally wxUniv (short for
24wxUniversal), since this widget set (implemented entirely within
25wxWidgets) is available whereever wxWidgets is available. Since this
26short overview is mainly about how to write wxWidgets applications
27for the GNOME<A HREF="http://www.gnome.org/"><SUP>[3]</SUP></A>
28desktop, I will focus on the GTK+ port, which is generally referred
29to as wxGTK.
30</P>
31<P>wxGTK still supports the old version GTK+ 1.2, but it now defaults
32to the uptodate version GTK+ 2.X, which is the basis for the current
33GNOME desktop. By way of using GTK+ 2.X and its underlying text
34rendering library Pango<A HREF="http://www.pango.org/"><SUP>[4]</SUP></A>,
35wxGTK fully supports the Unicode character set and it can render text
36in any language and script, that is supported by Pango.</P>
37<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>wxWidgets'
38design principles sofar</FONT></FONT></P>
39<P>The three main design goals of the wxWidgets library are
40portability across the supported platforms, complete integration with
41the supported platforms and a broad range of functionality covering
42most aspects of GUI and non-GUI application programming. Sometimes,
43various aspects of these design goals contradict each other and this
44holds true especially for the Linux platform which &ndash; from the
45point of view of the desktop environment integration &ndash; is
46lagging behind the other two major desktops (Windows and MacOS X)
47mostly because of the schism between the GTK+ based GNOME desktop and
48the Qt<A HREF="http://www.trolltech.com/"><SUP>[5]</SUP></A> based
49KDE<A HREF="http://www.kde.org/"><SUP>[6]</SUP></A> desktop. So far,
50the typical wxWidgets user targeted Windows, maybe MacOS X and Linux
51<I>in general</I>, so the aim was to make wxGTK applications run as
52well as possible on as many versions of Linux as possible, including
53those using the KDE environment. Luckily, most of these distributions
54included the GTK+ library (for running applications like the GIMP,
55GAIM, Evolution or Mozilla) whereas the GNOME libraries were not
56always installed by default. Also, the GNOME libraries didn't really
57offer substantial value so that the hassle of installing them was
58hardly justified. Therefore, much effort was spent on making wxGTK
59fully functional without relying on the GNOME libraries, mostly by
60reimplementing as much as sensible of the missing functionality. This
61included a usable file selection dialog, a printing system for
62PostScript output, code for querying MIME-types and file-icon
63associations, classes for storing application preferences and
64configurations, the possibility to display mini-apps in the taskbar,
65a full-featured HTML based help system etc. With all that in place
66you can write a pretty fully featured wxWidgets application on an
67old Linux system with little more installed than X11 and GTK+.</P>
68<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Recent
69developments</FONT></FONT></P>
70<P>Recently, several key issues have been addressed by the GNOME
71project. Sometimes integrated into the newest GTK+ releases (such as
72the file selecter), sometimes as part of the GNOME libraries (such as
73the new printing system with Pango integration or the mime-types
74handling in gnome-vfs), sometimes as outside projects (such as the
75media/video backend based on the Gstreamer<A HREF="http://gstreamer.freedesktop.org/"><SUP>[7]</SUP></A>
76project). Also, care has been taken to unify the look and feel of
77GNOME applications by writing down a number of rules (modestly called
78&bdquo;Human Interface Guidelines&ldquo;<A HREF="http://developer.gnome.org/projects/gup/hig"><SUP>[8]</SUP></A>)
79and more and more decisions are taken in a desktop neutral way (for
80both GNOME and KDE), mostly as part of the FreeDesktop<A HREF="http://www.freedesktop.org/"><SUP>[9]</SUP></A>
81initiative. This development together with the rising number of
82OpenSource projects using wxWidgets mainly for the Linux and more
83specifically GNOME desktop has led to a change of direction within
84the wxWidgets project, now working on making more use of GNOME
85features when present. The general idea is to call the various GNOME
86libraries if they are present and to offer a reasonable fallback if
87not. I'll detail on the various methods chosen below:</P>
88<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Printing
89system</FONT></FONT></P>
90<P>The old printing system ....</P>
91<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>MIME-type
92handling</FONT></FONT></P>
93<P>The old mime-type system used to simply query some files stored in
94&bdquo;typical&ldquo; locations for the respective desktop
95environment. Since both the format and the location of these files
96changed rather frequently, this system was never fully working as
97desired for reading the MIME-types and it never worked at all for
98writing MIME-types or icon/file associations. ...</P>
99<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>The
100new file dialog</FONT></FONT></P>
101<P>Previously, wxGTK application made use of a file dialog written in
102wxWidgets itself, since the default GTK+ file dialog was simplistic
103to say the least. This has changed with version GTK+ 2.4, where a
104nice and powerful dialog has been added. wxGTK is using it now.</P>
105<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>File
106configuration and preferences</FONT></FONT></P>
107<P>The usual Unix way of saving file configuration and preferences is
108to write and read a so called &bdquo;dot-file&ldquo;, basically a
109text file in a user's home directory starting with a dot. This was
110deemed insufficient by the GNOME desktop project and therefore they
111introduced the so called GConf system, for storing and retrieving
112application and sessions information....</P>
113<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Results
114and discussion</FONT></FONT></P>
115<P>One of wxWidgets' greatest merits is the ability to write an
116application that not only runs on different operating systems but
117especially under Linux even on rather old systems with only a minimal
118set of libraries installed &ndash; using a single application binary.
119This was possible since most of the relevant functionality was either
120located in the only required library (GTK+) or was implemented within
121wxWidgets. Recent development outside the actual GTK+ project has
122made it necessary to rethink this design and make use of other
123projects' features in order to stay uptodate with current
124techological trends. Therefore, a system was implemented within
125wxWidgets that queries the system at runtime about various libraries
126and makes use of their features whenever possible, but falls back to
127a reasonable solution if not. The result is that you can create and
128distribute application binaries that run on old Linux systems and
129integrate fully with modern desktops, if they are available. This is
130not currently possible with any other software.</P>
131<P>Copyright 2004 &copy; Robert Roebling, MD. No reprint permitted
132without written prior authorisation.<BR>Last modified 14/11/04</P>
133<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>About
134the author</FONT></FONT></P>
135<P>Robert Roebling works as a medical doctor in the Department of
136Neurology at the University clinic of Ulm in Germany. He has studied
137Computer Sciences for a few semesters and is involved in the
138wxWidgets projects since about 1996. He has started and written most
139of wxGTK port (beginning with GTK+ around 0.9) and has contributed to
140quite a number projects within wxWidgets, ranging from the image
141classes to Unicode support to making both the Windows and the GTK+
142ports work on embedded platform (mostly PDAs). He is happily married,
143has two children and never has time.</P>
144<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT FACE="Albany, sans-serif"><FONT SIZE=4>Links
145and citations</FONT></FONT></P>
146<P>[1] See the wxWidgets homepage at <A HREF="http://www.wxwidgets.org/">www.wxwidgets.org</A>.<BR>[2]
147See the GTK+ homepage at <A HREF="http://www.gtk.org/">www.gtk.org</A>.<BR>[3]
148See more about GNOME at <A HREF="http://www.gnome.org/">www.gnome.org</A>,
149<A HREF="http://www.gnomedesktop.org/">www.gnomedesktop.org</A>,
150<A HREF="http://www.gnomejournal.org/">www.gnomejournal.org</A>,
151<A HREF="http://www.gnomefiles.org/">www.gnomefiles.org</A>.<BR>[4]
152See the Pango homepage at <A HREF="http://www.pango.org/">www.pango.org</A>.<BR>[5]
153See the Qt homepage at <A HREF="http://www.trolltech.com/">www.trolltech.com</A>.<BR>[6]
154See the KDE homepage at <A HREF="http://www.kde.org/">www.kde.org</A>.<BR>[7]
155See Gstreamer homepage at <A HREF="http://gstreamer.freedesktop.org/">gstreamer.freedesktop.org</A>.<BR>[8]
156See GNOME's Human Interface Guidelines at
157<A HREF="http://developer.gnome.org/projects/gup/hig">developer.gnome.org/projects/gup/hig</A>.<BR>[9]
158See FreeDesktop's homepage at <A HREF="http://www.freedesktop.org/">www.freedesktop.org</A>.<BR><BR><BR>
159</P>
160</BODY>
161</HTML>