6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
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.
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.
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.
30 #endif /* __cplusplus */
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);
37 (will not ask to close existing capture file!) */
38 extern void menu_open_filename(gchar *cf_name);
41 * Menubar and context menus.
42 * @ingroup main_window_group
45 /** Write all recent capture filenames to the user's recent file.
46 * @param rf recent file
48 extern void menu_recent_file_write_all(FILE *rf);
50 /** User pushed a recent file submenu item.
52 * @param widget parent widget
54 extern void menu_open_recent_file_cmd(GtkWidget *widget);
56 /** The recent file read has finished, update the menu corresponding. */
57 extern void menu_recent_read_finished(void);
59 /** One of the name resolution menu items changed. */
60 extern void menu_name_resolution_changed(void);
62 /** The "Colorize Packet List" option changed. */
63 extern void menu_colorize_changed(gboolean packet_list_colorize);
65 /* Reset preferences menu on profile or preference change. */
66 extern void menu_prefs_reset(void);
68 extern void rebuild_visible_columns_menu (void);
71 /** The "Auto Scroll Packet List in Live Capture" option changed. */
72 extern void menu_auto_scroll_live_changed(gboolean auto_scroll_in);
75 /** Create a new menu.
77 * @param accel the created accelerator group
78 * @return the new menu
80 extern GtkWidget *main_menu_new(GtkAccelGroup **accel);
82 /** Set object data of menu, like g_object_set_data().
84 * @param path the path of the menu item
85 * @param key the key to set
86 * @param data the data to set
88 extern void set_menu_object_data(const gchar *path, const gchar *key, gpointer data);
90 /** The popup menu handler.
92 * @param widget the parent widget
93 * @param event the GdkEvent
94 * @param data the corresponding menu
96 extern gboolean popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data);
98 /** The packet history has changed, we need to update the menu.
100 * @param back_history some back history entries available
101 * @param forward_history some forward history entries available
103 extern void set_menus_for_packet_history(gboolean back_history, gboolean forward_history);
105 /** The current file has changed, we need to update the file set menu items.
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)
111 extern void set_menus_for_file_set(gboolean file_set, gboolean previous_file, gboolean next_file);
113 /** The popup menu. */
114 extern GtkWidget *popup_menu_object;
116 /* Update the packet list heading menu to indicate default
117 column justification. */
118 void menus_set_column_align_default (gboolean right_justify);
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);
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);
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 *);
134 /* Enable or disable menu items based on whether there's a capture in
136 void set_menus_for_capture_in_progress(gboolean);
138 /* Enable or disable menu items based on whether you have some captured
140 void set_menus_for_captured_packets(gboolean);
142 /* Enable or disable menu items based on whether a packet is selected. */
143 void set_menus_for_selected_packet(capture_file *cf);
148 #endif /* __cplusplus */
150 #endif /* __MENUS_H__ */