'extern gint popup_menu_handler' ==> 'extern gboolean popup_menu_handler' to match...
[obnox/wireshark/wip.git] / gtk / menus.h
1 /* menus.h
2  * Menu definitions
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
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 __MENUS_H__
26 #define __MENUS_H__
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32 /* Add a new recent capture filename to the "Recent Files" submenu
33    (duplicates will be ignored) */
34 extern void add_menu_recent_capture_file(gchar *cf_name);
35
36 /* Open a file(name)
37    (will not ask to close existing capture file!) */
38 extern void menu_open_filename(gchar *cf_name);
39
40 /** @file
41  *  Menubar and context menus.
42  *  @ingroup main_window_group
43  */
44
45 /** Write all recent capture filenames to the user's recent file.
46  * @param rf recent file
47  */
48 extern void menu_recent_file_write_all(FILE *rf);
49
50 /** User pushed a recent file submenu item.
51  *
52  * @param widget parent widget
53  */
54 extern void menu_open_recent_file_cmd(GtkWidget *widget);
55
56 /** The recent file read has finished, update the menu corresponding. */
57 extern void menu_recent_read_finished(void);
58
59 /** One of the name resolution menu items changed. */
60 extern void menu_name_resolution_changed(void);
61
62 /** The "Colorize Packet List" option changed. */
63 extern void menu_colorize_changed(gboolean packet_list_colorize);
64
65 /* Reset preferences menu on profile or preference change. */
66 extern void menu_prefs_reset(void);
67
68 extern void rebuild_visible_columns_menu (void);
69
70 #ifdef HAVE_LIBPCAP
71 /** The "Auto Scroll Packet List in Live Capture" option changed. */
72 extern void menu_auto_scroll_live_changed(gboolean auto_scroll_in);
73 #endif
74
75 /** Create a new menu.
76  *
77  * @param accel the created accelerator group
78  * @return the new menu
79  */
80 extern GtkWidget *main_menu_new(GtkAccelGroup **accel);
81
82 /** Set object data of menu, like g_object_set_data().
83  *
84  * @param path the path of the menu item
85  * @param key the key to set
86  * @param data the data to set
87  */
88 extern void set_menu_object_data(const gchar *path, const gchar *key, gpointer data);
89
90 /** The popup menu handler.
91  *
92  * @param widget the parent widget
93  * @param event the GdkEvent
94  * @param data the corresponding menu 
95  */
96 extern gboolean popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data);
97
98 /** The packet history has changed, we need to update the menu.
99  *
100  * @param back_history some back history entries available
101  * @param forward_history some forward history entries available
102  */
103 extern void set_menus_for_packet_history(gboolean back_history, gboolean forward_history);
104
105 /** The current file has changed, we need to update the file set menu items.
106  *
107  * @param file_set the current file is part of a file set
108  * @param previous_file the previous file set (or NULL)
109  * @param next_file the next file set (or NULL)
110  */
111 extern void set_menus_for_file_set(gboolean file_set, gboolean previous_file, gboolean next_file);
112
113 /** The popup menu. */
114 extern GtkWidget           *popup_menu_object;
115
116 /* Update the packet list heading menu to indicate default
117    column justification. */
118 void menus_set_column_align_default (gboolean right_justify);
119
120 /* Update the packet list heading menu to indicate if column can be resolved. */
121 void menus_set_column_resolved (gboolean resolved, gboolean can_resolve);
122
123 /* Enable or disable menu items based on whether a tree row is selected
124    and and on whether a "Match Selected" can be done. */
125 void set_menus_for_selected_tree_row(capture_file *cf);
126
127
128 /* Enable or disable menu items based on whether you have a capture file
129    you've finished reading and, if you have one, whether it's been saved
130    and whether it could be saved except by copying the raw packet data. */
131 void set_menus_for_capture_file(capture_file *);
132
133
134 /* Enable or disable menu items based on whether there's a capture in
135    progress. */
136 void set_menus_for_capture_in_progress(gboolean);
137
138 /* Enable or disable menu items based on whether you have some captured
139    packets. */
140 void set_menus_for_captured_packets(gboolean);
141
142 /* Enable or disable menu items based on whether a packet is selected. */
143 void set_menus_for_selected_packet(capture_file *cf);
144
145
146 #ifdef __cplusplus
147 }
148 #endif /* __cplusplus */
149
150 #endif /* __MENUS_H__ */