Fix build by #if 0 out unused de_sgsap_tmsi() function.
[obnox/wireshark/wip.git] / gtk / gui_stat_menu.h
1 /* gui_stat_menu.h
2  * GTK+-specific menu definitions for use by stats
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
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.
14  *
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.
19  *
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.
23  */
24
25 #ifndef __GTK_STAT_MENU_H__
26 #define __GTK_STAT_MENU_H__
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32 /** @file
33  * Add a new menu item for a stat.
34  */
35
36 /**
37  * Add a new menu item for a stat.
38  * This must be called after we've created the main menu, so it can't
39  * be called from the routine that registers stats - we have to introduce
40  * another per-stat registration routine.
41  *
42  * @param name the menu label
43  *
44  * @param group the menu group this stat should be registered to
45  *
46  * @param callback gets called when the menu item is selected; it should do
47  * the work of creating the stat window.
48  *
49  * @param selected_packet_enabled gets called by set_menus_for_selected_packet();
50  * it's passed a pointer to the "frame_data" structure for the current frame,
51  * if any, and to the "epan_dissect_t" structure for that frame, if any, and
52  * should return TRUE if the stat will work now (which might depend on whether
53  * a frame is selected and, if one is, on the frame) and FALSE if not.
54  *
55  * @param selected_tree_row_enabled gets called by
56  * set_menus_for_selected_tree_row(); it's passed a pointer to the
57  * "field_info" structure for the currently selected field, if any,
58  * and should return TRUE if the stat will work now (which might depend on
59  * whether a tree row is selected and, if one is, on the tree row) and
60  * FALSE if not.
61  *
62  * @param callback_data data for callback function
63  */    
64 extern void register_stat_menu_item(
65     const char *name, 
66     register_stat_group_t group,
67     GtkItemFactoryCallback callback,
68     gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data),
69     gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data),
70     gpointer callback_data);
71
72 /**
73  * Same as register_stat_menu_item() but with optional stock item.
74  *
75  * @param name the menu label
76  *
77  * @param group the menu group this stat should be registered to
78  *
79  * @param stock_id the stock_id (icon) to show, or NULL
80  *
81  * @param callback gets called when the menu item is selected; it should do
82  * the work of creating the stat window.
83  *
84  * @param selected_packet_enabled gets called by set_menus_for_selected_packet();
85  * it's passed a pointer to the "frame_data" structure for the current frame,
86  * if any, and to the "epan_dissect_t" structure for that frame, if any, and
87  * should return TRUE if the stat will work now (which might depend on whether
88  * a frame is selected and, if one is, on the frame) and FALSE if not.
89  *
90  * @param selected_tree_row_enabled gets called by
91  * set_menus_for_selected_tree_row(); it's passed a pointer to the
92  * "field_info" structure for the currently selected field, if any,
93  * and should return TRUE if the stat will work now (which might depend on
94  * whether a tree row is selected and, if one is, on the tree row) and
95  * FALSE if not.
96  *
97  * @param callback_data data for callback function
98  */
99 extern void register_stat_menu_item_stock(
100     const char *name, 
101     register_stat_group_t group,
102     const gchar *stock_id,
103     GtkItemFactoryCallback callback,
104     gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *, gpointer callback_data),
105     gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data),
106     gpointer callback_data);
107
108 #ifdef __cplusplus
109 }
110 #endif /* __cplusplus */
111
112 #endif /* __GTK_STAT_MENU_H__ */