added some more info to the statusbar (filesize, packet count, ..),
[obnox/wireshark/wip.git] / gtk / main.h
1 /* main.h
2  * Global defines, etc.
3  *
4  * $Id: main.h,v 1.42 2004/02/03 00:16:58 ulfl 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 __MAIN_H__
26 #define __MAIN_H__
27
28 #ifdef HAVE_CONFIG_H
29 #include "config.h"
30 #endif
31
32 #include "globals.h"
33
34 /*
35  * File under personal preferences directory in which GTK settings for
36  * Ethereal are stored.
37  */
38 #define RC_FILE "gtkrc"
39
40 #ifdef HAVE_LIBPCAP
41 #define DEF_READY_MESSAGE " Ready to load or capture"
42 #else
43 #define DEF_READY_MESSAGE " Ready to load file"
44 #endif
45
46 #define MATCH_SELECTED_REPLACE          0
47 #define MATCH_SELECTED_AND              1
48 #define MATCH_SELECTED_OR               2
49 #define MATCH_SELECTED_NOT              3
50 #define MATCH_SELECTED_AND_NOT          4
51 #define MATCH_SELECTED_OR_NOT           5
52
53 #define MATCH_SELECTED_MASK             0x0ff
54 #define MATCH_SELECTED_APPLY_NOW        0x100
55
56 typedef struct _selection_info {
57   GtkWidget *tree;
58   GtkWidget *text;
59 } selection_info;
60
61 #if GTK_MAJOR_VERSION < 2
62 extern GtkStyle *item_style;
63 #endif
64
65 void about_ethereal( GtkWidget *, gpointer);
66 void goto_framenum_cb(GtkWidget *, gpointer);
67 void goto_top_frame_cb(GtkWidget *w _U_, gpointer d _U_);
68 void goto_bottom_frame_cb(GtkWidget *w _U_, gpointer d _U_);
69 void view_zoom_in_cb(GtkWidget *w _U_, gpointer d _U_);
70 void view_zoom_out_cb(GtkWidget *w _U_, gpointer d _U_);
71 void view_zoom_100_cb(GtkWidget *w _U_, gpointer d _U_);
72 void match_selected_cb_replace_ptree( GtkWidget *, gpointer);
73 void match_selected_cb_and_ptree( GtkWidget *, gpointer);
74 void match_selected_cb_or_ptree( GtkWidget *, gpointer);
75 void match_selected_cb_not_ptree( GtkWidget *, gpointer);
76 void match_selected_cb_and_ptree_not( GtkWidget *, gpointer);
77 void match_selected_cb_or_ptree_not( GtkWidget *, gpointer);
78 void prepare_selected_cb_replace_ptree( GtkWidget *, gpointer);
79 void prepare_selected_cb_and_ptree( GtkWidget *, gpointer);
80 void prepare_selected_cb_or_ptree( GtkWidget *, gpointer);
81 void prepare_selected_cb_not_ptree( GtkWidget *, gpointer);
82 void prepare_selected_cb_and_ptree_not( GtkWidget *, gpointer);
83 void prepare_selected_cb_or_ptree_not( GtkWidget *, gpointer);
84 void match_selected_cb_replace_plist( GtkWidget *, gpointer);
85 void match_selected_cb_and_plist( GtkWidget *, gpointer);
86 void match_selected_cb_or_plist( GtkWidget *, gpointer);
87 void match_selected_cb_not_plist( GtkWidget *, gpointer);
88 void match_selected_cb_and_plist_not( GtkWidget *, gpointer);
89 void match_selected_cb_or_plist_not( GtkWidget *, gpointer);
90 void prepare_selected_cb_replace_plist( GtkWidget *, gpointer);
91 void prepare_selected_cb_and_plist( GtkWidget *, gpointer);
92 void prepare_selected_cb_or_plist( GtkWidget *, gpointer);
93 void prepare_selected_cb_not_plist( GtkWidget *, gpointer);
94 void prepare_selected_cb_and_plist_not( GtkWidget *, gpointer);
95 void prepare_selected_cb_or_plist_not( GtkWidget *, gpointer);
96 void file_quit_cmd_cb(GtkWidget *, gpointer);
97 void file_print_cmd_cb(GtkWidget *, gpointer);
98 void tools_plugins_cmd_cb(GtkWidget *, gpointer);
99 void expand_all_cb(GtkWidget *, gpointer);
100 void collapse_all_cb(GtkWidget *, gpointer);
101 void resolve_name_cb(GtkWidget *, gpointer);
102 void reftime_frame_cb(GtkWidget *, gpointer, guint);
103
104 extern gboolean dfilter_combo_add_recent(gchar *s);
105 extern void dfilter_combo_add_empty(void);
106 extern void dfilter_recent_combo_write_all(FILE *rf);
107
108 extern gboolean main_do_quit(void);
109 extern void main_widgets_rearrange(void);
110 extern int main_filter_packets(capture_file *cf, const gchar *dftext);
111 extern void dnd_open_file_cmd(gpointer cf_name);
112 extern void packets_bar_update(void);
113
114
115 typedef enum {
116         FA_SUCCESS,
117         FA_FONT_NOT_RESIZEABLE,
118         FA_FONT_NOT_AVAILABLE
119 } fa_ret_t;
120 extern fa_ret_t font_apply(void);
121 #if GTK_MAJOR_VERSION < 2
122 char *font_boldify(const char *);
123 void set_fonts(GdkFont *regular, GdkFont *bold);
124 #else
125 void set_fonts(PangoFontDescription *regular, PangoFontDescription *bold);
126 #endif
127 void set_last_open_dir(char *dirname);
128
129 #endif /* __MAIN_H__ */