Use _WIN32 rather than WIN32 to determine if we're compiling on Win32;
[obnox/wireshark/wip.git] / gtk / font_utils.h
1 /* font_utils.h
2  * Declarations of utilities to use for font manipulation
3  *
4  * $Id$
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
26 /** @file
27  * Utilities for font manipulation. 
28  *
29  * There are two different fonts used:
30  * - the application font for menu's, dialog's and such
31  * - the user font for the packet panes
32  * 
33  * The user font is also available in regular (m_r_font) and bold (m_b_font) versions,
34  * see gtkglobals.h.
35  */
36
37 #ifndef __FONT_UTILS_H__
38 #define __FONT_UTILS_H__
39
40 /** Init the application and user fonts at program start. */
41 extern void font_init(void);
42
43 /** Return value from font_apply() */
44 typedef enum {
45         FA_SUCCESS,             /**< function succeeded */
46         FA_FONT_NOT_RESIZEABLE, /**< the choosen font isn't resizable */
47         FA_FONT_NOT_AVAILABLE   /**< the choosen font isn't available */
48 } fa_ret_t;
49
50 /** Applies a new user font, corresponding to the preferences font name and recent zoom level. 
51  *  Will also redraw the screen.
52  *
53  * @return if the new font could be set or not
54  */
55 extern fa_ret_t user_font_apply(void);
56
57 #ifdef _WIN32 
58 #if GTK_MAJOR_VERSION < 2
59 /** Init the application font (GTK1 only). 
60  *
61  * @param top_level_w the top level window
62  */
63 extern void app_font_gtk1_init(GtkWidget *top_level_w);
64 #endif
65 #endif
66
67 /** Test, if the given font name is available.
68  *
69  * @param font_name the font to test
70  * @return TRUE, if this font is available
71  */
72 extern gboolean user_font_test(gchar *font_name);
73
74 /** Get the regular user font.
75  *
76  * @return the regular user font
77  */
78 extern FONT_TYPE *user_font_get_regular(void);
79
80 /** Get the bold user font.
81  *
82  * @return the bold user font
83  */
84 extern FONT_TYPE *user_font_get_bold(void);
85
86 #if GTK_MAJOR_VERSION < 2
87 /** Get the regular user font height.
88  *
89  * @return the regular user font height
90  */
91 extern guint user_font_get_regular_height(void);
92
93 /** Get the regular user font width.
94  *
95  * @return the regular user font width
96  */
97 extern guint user_font_get_regular_width(void);
98 #endif
99
100 #endif