2 * Main menu definitions
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.
25 #ifndef __MAIN_MENU_H__
26 #define __MAIN_MENU_H__
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 * Menubar and context menus.
38 * @ingroup main_window_group
41 /** Write all recent capture filenames to the user's recent file.
42 * @param rf recent file
44 extern void menu_recent_file_write_all(FILE *rf);
46 /** User pushed a recent file submenu item.
48 * @param widget parent widget
50 extern void menu_open_recent_file_cmd(GtkWidget *widget);
52 /** The recent file read has finished, update the menu corresponding. */
53 extern void menu_recent_read_finished(void);
55 /** One of the name resolution menu items changed. */
56 extern void menu_name_resolution_changed(void);
58 /** The "Colorize Packet List" option changed. */
59 extern void menu_colorize_changed(gboolean packet_list_colorize);
62 /** The "Auto Scroll Packet List in Live Capture" option changed. */
63 extern void menu_auto_scroll_live_changed(gboolean auto_scroll_in);
66 /** Create a new menu.
68 * @param accel the created accelerator group
69 * @return the new menu
71 extern GtkWidget *main_menu_new(GtkAccelGroup **accel);
73 /** Set object data of menu, like g_object_set_data().
75 * @param path the path of the menu item
76 * @param key the key to set
77 * @param data the data to set
79 extern void set_menu_object_data(const gchar *path, const gchar *key, gpointer data);
81 /** The popup menu handler.
83 * @param widget the parent widget
84 * @param event the GdkEvent
85 * @param data the corresponding menu
87 extern gint popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data);
89 /** The packet history has changed, we need to update the menu.
91 * @param back_history some back history entries available
92 * @param forward_history some forward history entries available
94 extern void set_menus_for_packet_history(gboolean back_history, gboolean forward_history);
96 /** The current file has changed, we need to update the file set menu items.
98 * @param file_set the current file is part of a file set
99 * @param previous_file the previous file set (or NULL)
100 * @param next_file the next file set (or NULL)
102 extern void set_menus_for_file_set(gboolean file_set, gboolean previous_file, gboolean next_file);
104 /** The popup menu. */
105 extern GtkWidget *popup_menu_object;
108 /* Enable or disable menu items based on whether a tree row is selected
109 and and on whether a "Match Selected" can be done. */
110 void set_menus_for_selected_tree_row(capture_file *cf);
113 /* Enable or disable menu items based on whether you have a capture file
114 you've finished reading and, if you have one, whether it's been saved
115 and whether it could be saved except by copying the raw packet data. */
116 void set_menus_for_capture_file(capture_file *);
119 /* Enable or disable menu items based on whether there's a capture in
121 void set_menus_for_capture_in_progress(gboolean);
123 /* Enable or disable menu items based on whether you have some captured
125 void set_menus_for_captured_packets(gboolean);
127 /* Enable or disable menu items based on whether a packet is selected. */
128 void set_menus_for_selected_packet(capture_file *cf);
133 #endif /* __cplusplus */
135 #endif /* __MAIN_MENU_H__ */