2 * Menu definitions for use by taps
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@ethereal.com>
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 __GTKGUITAPMENU_H__
26 #define __GTKGUITAPMENU_H__
30 #endif /* __cplusplus */
33 * Add a new menu item for a tap.
36 /** The menu group this tap should be registered at. */
38 REGISTER_TAP_GROUP_NONE,
39 REGISTER_TAP_GROUP_GENERIC,
40 REGISTER_TAP_GROUP_CONVERSATION_LIST,
41 REGISTER_TAP_GROUP_ENDPOINT_LIST,
42 REGISTER_TAP_GROUP_RESPONSE_TIME
43 } REGISTER_TAP_GROUP_E;
46 * Add a new menu item for a tap.
47 * This must be called after we've created the main menu, so it can't
48 * be called from the routine that registers taps - we have to introduce
49 * another per-tap registration routine.
51 * @param name the menu label
53 * @param group the menu group, this tap should be registered to
55 * @param callback gets called when the menu item is selected; it should do
56 * the work of creating the tap window.
58 * @param selected_packet_enabled gets called by set_menus_for_selected_packet();
59 * it's passed a pointer to the "frame_data" structure for the current frame,
60 * if any, and to the "epan_dissect_t" structure for that frame, if any, and
61 * should return TRUE if the tap will work now (which might depend on whether
62 * a frame is selected and, if one is, on the frame) and FALSE if not.
64 * @param selected_tree_row_enabled gets called by
65 * set_menus_for_selected_tree_row(); it's passed a pointer to the
66 * "field_info" structure for the currently selected field, if any,
67 * and should return TRUE if the tap will work now (which might depend on
68 * whether a tree row is selected and, if one is, on the tree row) and
71 * @param callback_data data for callback function
73 extern void register_tap_menu_item(
75 REGISTER_TAP_GROUP_E group,
76 GtkItemFactoryCallback callback,
77 gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *),
78 gboolean (*selected_tree_row_enabled)(field_info *),
79 gpointer callback_data);
83 #endif /* __cplusplus */
85 #endif /* __GTKGUITAPMENU_H__ */