1 <!-- EDG Chapter User Interface -->
4 <chapter id="ChapterUserInterface">
5 <title>User Interface</title>
7 <section id="ChUIIntro">
8 <title>Introduction</title>
10 Ethereal can be "logically" seperated into the backend (dissecting of
11 protocols, file load/save, capturing, ...) and the frontend (the user
12 interface). However, there's currently no clear seperation between
13 these two parts (no clear API definition), but this might change in the
17 The following frontends are currently maintained by the Ethereal
21 Ethereal, GTK1.x based
24 Ethereal, GTK 2.x based
27 Tethereal, console based
30 There are other Ethereal frontends existing, not developped nor
31 maintained by the Ethereal development team:
34 Packetyzer (Win32 native interface, written in Delphi and released
36 <ulink url="http://www.networkchemistry.com/products/packetyzer/"/>)
39 hethereal (web based frontend, not actively maintained and not
43 This chapter is focussed on the Ethereal frontend, and especially on
44 the GTK specific things.
48 <section id="ChUIGTK">
49 <title>The GTK library</title>
51 Wireshark is based on the GTK toolkit, see: <ulink url="http://www.gtk.org"/>
53 details. GTK is designed to hide the details of the underlying GUI in
54 a platform independant way. As this is appreciated for a
55 multiplatform tool, this has some drawbacks, as it will result in a
56 somewhat "non native" look and feel. For example: on win32, the "File
57 open" dialog of Ethereal looks very different compared to the native
58 win32 dialog the win32 users are used to see.
61 GTK is available for a lot of different platforms including, but not
62 limitted, to: unix/linux, mac os x and win32. It's the foundation of
63 the famous GNOME desktop, so the future development of GTK should be
65 GTK is implemented in plain C (as Ethereal itself), and available under
66 the LGPL (Lesser General Public License), being free to used by
67 commercial and noncommercial applications.
70 There are other similar toolkits like Qt, wxwidgets, ..., which could
72 be used for Wireshark. There's no "one and only" reason for or against
73 any of these toolkits. However, the decision towards GTK was made a
77 At the time this document is written there are two major GTK versions
82 <section id="ChUIGTK1x">
83 <title>GTK Version 1.x</title>
85 GTK 1.x was the first major release. Today there are 1.2.x and 1.3.x
86 versions "in the wild", with only very limitted differences in the API.
89 Advantages (compared to GTK 2.x):
92 available on a lot of different platforms
95 very stable as it's matured for quite a while now
101 the look and feel is a bit oldfashioned
104 not recommended for future developments
107 GTK 1.x depends on the following libraries:
110 GDK (GDK is the abstraction layer
111 that allows GTK+ to support multiple
112 windowing systems. GDK provides drawing and window system facilities
113 on X11, Windows, and the Linux framebuffer device.)
116 GLib (A general-purpose utility
117 library, not specific to graphical user interfaces.
118 GLib provides many useful data types, macros, type conversions,
119 string utilities, file utilities, a main loop abstraction, and so on.)
122 GTK 1.x is working on GLib 1.x (typical for Unix like systems) or 2.x
123 (typical for Win32 like systems).
126 XXX: include Ethereal GTK1 screenshot
131 <section id="ChUIGTK2x">
132 <title>GTK Version 2.x</title>
134 Advantages (compared to GTK 1.x):
137 nice look and feel (compared to version 1.x)
140 recommended for future developments
146 not available on all platforms (compared to version 1.x)
149 maybe a bit less stable compared to version 1.x (but should be
150 production stable too)
153 more dependencies compared to 1.x, see below
156 GTK 2.x depends on the following libraries:
159 GObject (Object library. Basis for GTK and others)
162 GLib (A general-purpose utility
163 library, not specific to graphical user interfaces.
164 GLib provides many useful data types, macros, type conversions,
165 string utilities, file utilities, a main loop abstraction, and so on.)
168 Pango (Pango is a library for internationalized text handling. It centers
169 around the #PangoLayout object, representing a paragraph of text.
170 Pango provides the engine for #GtkTextView, #GtkLabel, #GtkEntry, and
171 other widgets that display text.)
174 ATK (ATK is the Accessibility Toolkit. It provides a set of generic
175 interfaces allowing accessibility technologies to interact with a
176 graphical user interface. For example, a screen reader uses ATK to
177 discover the text in an interface and read it to blind users. GTK+
178 widgets have built-in support for accessibility using the ATK
182 GdkPixbuf (This is a small library which allows you to create #GdkPixbuf
183 ("pixel buffer") objects from image data or image files. Use a
184 #GdkPixbuf in combination with #GtkImage to display images.)
187 GDK (GDK is the abstraction layer that allows GTK+ to support multiple
188 windowing systems. GDK provides drawing and window system facilities
189 on X11, Windows, and the Linux framebuffer device.)
192 XXX: include Ethereal GTK2 screenshot
196 <section id="ChUIGTKCompat">
197 <title>Compatibility between 1.x and 2.x</title>
199 The GTK library itself defines some values which makes it easy to
200 distinguish between the versions, e.g.:
201 GTK_MAJOR_VERSION GTK_MINOR_VERSION
202 will be set to the GTK version at compile time somewhere inside the
206 There are some common compatibility issues in Wireshark between the two
210 Most of them (the more simple ones) are collected in
211 gtk/compat_macros.h and can be used in an version independant manner.
214 However, there are major differences between the two versions, making
215 it necessary to distinct between them, like:
218 #if GTK_MAJOR_VERSION >= 2
227 <section id="ChUIGTKWeb">
228 <title>GTK resources on the web</title>
230 You can find several resources about GTK.
233 First of all, have a look at: <ulink url="http://www.gtk.org"/> as this
234 will be the first place to look at. If you want to develop GTK related
235 things for Wireshark, the most important place might
236 be the GTK API documentation at: <ulink url="http://gtk.org/api/"/>.
239 Several mailing lists are available about GTK development, see <ulink
240 url="http://gtk.org/mailinglists.html"/>, the gtk-app-devel-list
244 Theres no Win32 specific GTK mailing list. If you want to post
245 a Win32 specific problem (e.g. a problem in the GtkFileChooser dialog)
246 and you are sure that it's really win32 specific, you
247 could send it to GIMPwin-users at <ulink
248 url="http://www.gimp.org/mail_lists.html"/>.
251 As it's often done wrong: You should post a mail to *help* the developers
252 there instead of only complaining. Posting such a thing like "I don't like
253 your dialog, it looks ugly" won't be much helpful. You might think about
254 what you dislike and describe why you dislike it and a suggestion for a
261 <section id="ChUIGUIDocs">
262 <title>GUI Reference documents</title>
264 Although the GUI development of Wireshark is platform independant, the
265 Ethereal development team tries to
266 follow the GNOME Human Interface Guidelines (HIG) where appropriate.
267 This is the case, because both GNOME and Ethereal are based on the GTK+
268 toolkit and the GNOME HIG is excellently written and easy to understand.
271 For further reference, see the following documents:
274 GNOME Human Interface Guidelines at:
275 <ulink url="http://developer.gnome.org/projects/gup/hig/"/>
278 KDE user interface related documents at:
279 <ulink url="http://developer.kde.org/documentation/library/ui.html"/>
282 Win32 XXX - where are good win32 styleguides available?
288 <section id="ChUIGTKDialogs">
289 <title>Adding/Extending Dialogs</title>
291 This is usually the main area for contributing new user interface features.
294 XXX: add the various functions from gtk/dlg_utils.h
298 <section id="ChUIGTKWidgetNamings">
299 <title>Widget naming</title>
301 It seems to become common sense, to name the widgets with some
302 descriptive trailing, like:
305 xy_lb = gtk_label_new();
308 xy_cb = gtk_checkbox_new();
311 XXX: add more examples
314 However, this schema isn't used at all places inside the code.
319 <section id="ChUIGTKPitfalls">
320 <title>Common GTK programming pitfalls</title>
322 There are some common pitfalls in GTK programming.
325 <section id="ChUIGTKShowAll">
326 <title>Usage of gtk_widget_show() / gtk_widget_show_all()</title>
328 When a GTK widget is created it will be hidden by default. In order to
329 show it, a call to gtk_widget_show() has to be done.
332 It isn't necessary to do this for each and every widget created. A call
334 gtk_widget_show_all() on the parent of all the widgets in question
335 (e.g. a dialog window) can be done, so all of it's child widgets will
343 <!-- End of EUG Chapter User Interface -->