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 (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);
69 /** The "Auto Scroll Packet List in Live Capture" option changed. */
70 extern void menu_auto_scroll_live_changed(gboolean auto_scroll_in);
73 /** Create a new menu.
75 * @param accel the created accelerator group
76 * @return the new menu
78 extern GtkWidget *main_menu_new(GtkAccelGroup **accel);
80 /** Set object data of menu, like g_object_set_data().
82 * @param path the path of the menu item
83 * @param key the key to set
84 * @param data the data to set
86 extern void set_menu_object_data(const gchar *path, const gchar *key, gpointer data);
88 /** The popup menu handler.
90 * @param widget the parent widget
91 * @param event the GdkEvent
92 * @param data the corresponding menu
94 extern gint popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data);
96 /** The packet history has changed, we need to update the menu.
98 * @param back_history some back history entries available
99 * @param forward_history some forward history entries available
101 extern void set_menus_for_packet_history(gboolean back_history, gboolean forward_history);
103 /** The current file has changed, we need to update the file set menu items.
105 * @param file_set the current file is part of a file set
106 * @param previous_file the previous file set (or NULL)
107 * @param next_file the next file set (or NULL)
109 extern void set_menus_for_file_set(gboolean file_set, gboolean previous_file, gboolean next_file);
111 /** The popup menu. */
112 extern GtkWidget *popup_menu_object;
114 /* Update the packet list heading menu to indicate default
115 column justification. */
116 void menus_set_column_align_default (gboolean right_justify);
118 /* Enable or disable menu items based on whether a tree row is selected
119 and and on whether a "Match Selected" can be done. */
120 void set_menus_for_selected_tree_row(capture_file *cf);
123 /* Enable or disable menu items based on whether you have a capture file
124 you've finished reading and, if you have one, whether it's been saved
125 and whether it could be saved except by copying the raw packet data. */
126 void set_menus_for_capture_file(capture_file *);
129 /* Enable or disable menu items based on whether there's a capture in
131 void set_menus_for_capture_in_progress(gboolean);
133 /* Enable or disable menu items based on whether you have some captured
135 void set_menus_for_captured_packets(gboolean);
137 /* Enable or disable menu items based on whether a packet is selected. */
138 void set_menus_for_selected_packet(capture_file *cf);
143 #endif /* __cplusplus */
145 #endif /* __MAIN_MENU_H__ */