From Chris Heath: fix up the check for printable ASCII done on Windows
[obnox/wireshark/wip.git] / gtk / gtkglobals.h
1 /* gtkglobals.h
2  * GTK-related Global defines, etc.
3  *
4  * $Id: gtkglobals.h,v 1.22 2003/08/01 01:39:01 guy Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@ethereal.com>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25 #ifndef __GTKGLOBALS_H__
26 #define __GTKGLOBALS_H__
27
28 extern GtkWidget *top_level, *packet_list, *tree_view, *byte_nb_ptr;
29 #if GTK_MAJOR_VERSION < 2
30 extern GdkFont   *m_r_font, *m_b_font;
31 extern guint      m_font_height, m_font_width;
32
33 extern GtkStyle  *item_style;
34
35 void set_plist_font(GdkFont *font);
36 #else
37 extern PangoFontDescription *m_r_font, *m_b_font;
38
39 void set_plist_font(PangoFontDescription *font);
40 #endif
41 void set_plist_sel_browse(gboolean);
42
43 #ifdef _WIN32
44 /*
45  * XXX - "isprint()" can return "true" for non-ASCII characters, but
46  * those don't work with GTK+ on Windows, as GTK+ on Windows assumes
47  * UTF-8 strings.  Until we fix up Ethereal to properly handle
48  * non-ASCII characters in all output (both GUI displays and text
49  * printouts) on all platforms including Windows, we work around
50  * the problem by escaping all characters that aren't printable ASCII.
51  */
52 #undef isprint
53 #define isprint(c) (c >= 0x20 && c < 0x7f)
54 #endif
55
56 #endif