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 /*#define MAIN_MENU_USE_UIMANAGER 1 */
34 /* Add a new recent capture filename to the "Recent Files" submenu
35 (duplicates will be ignored) */
36 extern void add_menu_recent_capture_file(gchar *cf_name);
39 (will not ask to close existing capture file!) */
40 extern void menu_open_filename(gchar *cf_name);
43 * Menubar and context menus.
44 * @ingroup main_window_group
47 /** Write all recent capture filenames to the user's recent file.
48 * @param rf recent file
50 extern void menu_recent_file_write_all(FILE *rf);
52 /** User pushed a recent file submenu item.
54 * @param widget parent widget
56 #ifdef MAIN_MENU_USE_UIMANAGER
57 extern void menu_open_recent_file_cmd(GtkAction *action);
59 extern void menu_open_recent_file_cmd(GtkWidget *widget);
62 /** The recent file read has finished, update the menu corresponding. */
63 extern void menu_recent_read_finished(void);
65 /** One of the name resolution menu items changed. */
66 extern void menu_name_resolution_changed(void);
68 /** The "Colorize Packet List" option changed. */
69 extern void menu_colorize_changed(gboolean packet_list_colorize);
71 /* Reset preferences menu on profile or preference change. */
72 extern void menu_prefs_reset(void);
74 extern void rebuild_visible_columns_menu (void);
77 /** The "Auto Scroll Packet List in Live Capture" option changed. */
78 extern void menu_auto_scroll_live_changed(gboolean auto_scroll_in);
81 /** Create a new menu.
83 * @param accel the created accelerator group
84 * @return the new menu
86 extern GtkWidget *main_menu_new(GtkAccelGroup **accel);
88 /** Set object data of menu, like g_object_set_data().
90 * @param path the path of the menu item
91 * @param key the key to set
92 * @param data the data to set
94 extern void set_menu_object_data(const gchar *path, const gchar *key, gpointer data);
95 #ifndef MAIN_MENU_USE_UIMANAGER
96 extern void set_menu_object_data_old(const gchar *path, const gchar *key, gpointer data);
97 #endif /* MAIN_MENU_USE_UIMANAGER */
99 /** The popup menu handler.
101 * @param widget the parent widget
102 * @param event the GdkEvent
103 * @param data the corresponding menu
105 extern gboolean popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data);
107 /** The packet history has changed, we need to update the menu.
109 * @param back_history some back history entries available
110 * @param forward_history some forward history entries available
112 extern void set_menus_for_packet_history(gboolean back_history, gboolean forward_history);
114 /** The current file has changed, we need to update the file set menu items.
116 * @param file_set the current file is part of a file set
117 * @param previous_file the previous file set (or NULL)
118 * @param next_file the next file set (or NULL)
120 extern void set_menus_for_file_set(gboolean file_set, gboolean previous_file, gboolean next_file);
122 /** The popup menu. */
123 extern GtkWidget *popup_menu_object;
125 /* Update the packet list heading menu to indicate default
126 column justification. */
127 void menus_set_column_align_default (gboolean right_justify);
129 /* Update the packet list heading menu to indicate if column can be resolved. */
130 void menus_set_column_resolved (gboolean resolved, gboolean can_resolve);
132 /* Fetch the statusbar profiles submenu */
133 extern GtkWidget *menus_get_profiles_menu (void);
135 /* Enable or disable menu items based on whether a tree row is selected
136 and and on whether a "Match Selected" can be done. */
137 void set_menus_for_selected_tree_row(capture_file *cf);
140 /* Enable or disable menu items based on whether you have a capture file
141 you've finished reading and, if you have one, whether it's been saved
142 and whether it could be saved except by copying the raw packet data. */
143 void set_menus_for_capture_file(capture_file *);
146 /* Enable or disable menu items based on whether there's a capture in
148 void set_menus_for_capture_in_progress(gboolean);
150 /* Enable or disable menu items based on whether you have some captured
152 void set_menus_for_captured_packets(gboolean);
154 /* Enable or disable menu items based on whether a packet is selected. */
155 void set_menus_for_selected_packet(capture_file *cf);
157 /* Enable or disable menu items based on configuration profile */
158 void set_menus_for_profiles(gboolean default_profile);
160 #ifdef MAIN_MENU_USE_UIMANAGER
161 #define MENU_BAR_PATH_FILE_OPEN "/Menubar/FileMenu/Open"
162 #define MENU_BAR_PATH_EDIT_COPY_AS_FLT "/Menubar/EditMenu/Copy/AsFilter"
163 #define MENU_BAR_PATH_ANALYZE_DISPLAY_FLT "/Menubar/AnalyzeMenu/DisplayFilters"
164 #define MENU_BAR_PATH_ANALYZE_FOLLOW_TCP_STREAM "/Menubar/AnalyzeMenu/FollowTCPStream"
165 #define MENU_BAR_PATH_ANALYZE_FOLLOW_UDP_STREAM "/Menubar/AnalyzeMenu/FollowUDPStream"
166 #define MENU_BAR_PATH_ANALYZE_FOLLOW_SSL_STREAM "/Menubar/AnalyzeMenu/FollowSSLStream"
167 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_SEL "/Menubar/AnalyzeMenu/ApplyAsFilter/Selected"
168 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_NOT_SEL "/Menubar/AnalyzeMenu/ApplyAsFilter/NotSelected"
169 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_AND_SEL "/Menubar/AnalyzeMenu/ApplyAsFilter/AndSelected"
170 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_OR_SEL "/Menubar/AnalyzeMenu/ApplyAsFilter/OrSelected"
171 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_AND_NOT_SEL "/Menubar/AnalyzeMenu/ApplyAsFilter/AndNotSelected"
172 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_OR_NOT_SEL "/Menubar/AnalyzeMenu/ApplyAsFilter/OrNotSelected"
174 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_SEL "/Menubar/AnalyzeMenu/PrepareaFilter/Selected"
175 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_NOT_SEL "/Menubar/AnalyzeMenu/PrepareaFilter/NotSelected"
176 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_AND_SEL "/Menubar/AnalyzeMenu/PrepareaFilter/AndSelected"
177 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_OR_SEL "/Menubar/AnalyzeMenu/PrepareaFilter/OrSelected"
178 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_AND_NOT_SEL "/Menubar/AnalyzeMenu/PrepareaFilter/AndNotSelected"
179 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_OR_NOT_SEL "/Menubar/AnalyzeMenu/PrepareaFilter/OrNotSelected"
182 #define MENU_BAR_PATH_FILE_OPEN "/File/Open..."
183 #define MENU_BAR_PATH_EDIT_COPY_AS_FLT "/Edit/Copy/As Filter"
184 #define MENU_BAR_PATH_ANALYZE_DISPLAY_FLT "/Analyze/Display Filters..."
185 #define MENU_BAR_PATH_ANALYZE_FOLLOW_TCP_STREAM "/Analyze/Follow TCP Stream"
186 #define MENU_BAR_PATH_ANALYZE_FOLLOW_UDP_STREAM "/Analyze/Follow UDP Stream"
187 #define MENU_BAR_PATH_ANALYZE_FOLLOW_SSL_STREAM "/Analyze/Follow SSL Stream"
188 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_SEL "/Analyze/Apply as Filter/Selected"
189 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_NOT_SEL "/Analyze/Apply as Filter/Not Selected"
190 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_AND_SEL "/Analyze/Apply as Filter/... and Selected"
191 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_OR_SEL "/Analyze/Apply as Filter/... or Selected"
192 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_AND_NOT_SEL "/Analyze/Apply as Filter/... and not Selected"
193 #define MENU_BAR_PATH_ANALYZE_APL_AS_FLT_OR_NOT_SEL "/Analyze/Apply as Filter/... or not Selected"
195 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_SEL "/Analyze/Prepare a Filter/Selected"
196 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_NOT_SEL "/Analyze/Prepare a Filter/Not Selected"
197 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_AND_SEL "/Analyze/Prepare a Filter/... and Selected"
198 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_OR_SEL "/Analyze/Prepare a Filter/... or Selected"
199 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_AND_NOT_SEL "/Analyze/Prepare a Filter/... and not Selected"
200 #define MENU_BAR_PATH_ANALYZE_PREP_A_FLT_OR_NOT_SEL "/Analyze/Prepare a Filter/... or not Selected"
201 #endif /* MAIN_MENU_USE_UIMANAGER */
203 #define PACKET_LIST_POPUP_PATH_ANALYZE_FOLLOW_TCP_STREAM "/PacketListMenuPopup/FollowTCPStream"
204 #define PACKET_LIST_POPUP_PATH_ANALYZE_FOLLOW_UDP_STREAM "/PacketListMenuPopup/FollowUDPStream"
205 #define PACKET_LIST_POPUP_PATH_ANALYZE_FOLLOW_SSL_STREAM "/PacketListMenuPopup/FollowSSLStream"
206 #define PACKET_LIST_POPUP_PATH_CONV_FLT_ETH "/PacketListMenuPopup/ConversationFilter/Ethernet"
207 #define PACKET_LIST_POPUP_PATH_CONV_FLT_IP "/PacketListMenuPopup/ConversationFilter/IP"
208 #define PACKET_LIST_POPUP_PATH_CONV_FLT_TCP "/PacketListMenuPopup/ConversationFilter/TCP"
209 #define PACKET_LIST_POPUP_PATH_CONV_FLT_UDP "/PacketListMenuPopup/ConversationFilter/UDP"
210 #define PACKET_LIST_POPUP_PATH_CONV_FLT_PN_CBA_SERV "/PacketListMenuPopup/ConversationFilter/PN-CBA"
215 #endif /* __cplusplus */
217 #endif /* __MENUS_H__ */