Trivial reformatting
[obnox/wireshark/wip.git] / gtk / menus.h
1 /* menus.h
2  * Menu definitions
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 __MAIN_MENU_H__
26 #define __MAIN_MENU_H__
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
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);
35
36 /* Open a file(name)
37    (will not ask to close existing capture file!) */
38 extern void menu_open_filename(gchar *cf_name);
39
40 /** @file
41  *  Menubar and context menus.
42  *  @ingroup main_window_group
43  */
44
45 /** Write all recent capture filenames to the user's recent file.
46  * @param rf recent file
47  */
48 extern void menu_recent_file_write_all(FILE *rf);
49
50 /** User pushed a recent file submenu item.
51  *
52  * @param widget parent widget
53  */
54 extern void menu_open_recent_file_cmd(GtkWidget *widget);
55
56 /** The recent file read has finished, update the menu corresponding. */
57 extern void menu_recent_read_finished(void);
58
59 /** One of the name resolution menu items changed. */
60 extern void menu_name_resolution_changed(void);
61
62 /** The "Colorize Packet List" option changed. */
63 extern void menu_colorize_changed(gboolean packet_list_colorize);
64
65 /* Reset preferences menu on profile or preference change. */
66 extern void menu_prefs_reset(void);
67
68 #ifdef HAVE_LIBPCAP
69 /** The "Auto Scroll Packet List in Live Capture" option changed. */
70 extern void menu_auto_scroll_live_changed(gboolean auto_scroll_in);
71 #endif
72
73 /** Create a new menu.
74  *
75  * @param accel the created accelerator group
76  * @return the new menu
77  */
78 extern GtkWidget *main_menu_new(GtkAccelGroup **accel);
79
80 /** Set object data of menu, like g_object_set_data().
81  *
82  * @param path the path of the menu item
83  * @param key the key to set
84  * @param data the data to set
85  */
86 extern void set_menu_object_data(const gchar *path, const gchar *key, gpointer data);
87
88 /** The popup menu handler.
89  *
90  * @param widget the parent widget
91  * @param event the GdkEvent
92  * @param data the corresponding menu 
93  */
94 extern gint popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data);
95
96 /** The packet history has changed, we need to update the menu.
97  *
98  * @param back_history some back history entries available
99  * @param forward_history some forward history entries available
100  */
101 extern void set_menus_for_packet_history(gboolean back_history, gboolean forward_history);
102
103 /** The current file has changed, we need to update the file set menu items.
104  *
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)
108  */
109 extern void set_menus_for_file_set(gboolean file_set, gboolean previous_file, gboolean next_file);
110
111 /** The popup menu. */
112 extern GtkWidget           *popup_menu_object;
113
114 /* Update the packet list heading menu to indicate default
115    column justification. */
116 void menus_set_column_align_default (gboolean right_justify);
117
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);
121
122
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 *);
127
128
129 /* Enable or disable menu items based on whether there's a capture in
130    progress. */
131 void set_menus_for_capture_in_progress(gboolean);
132
133 /* Enable or disable menu items based on whether you have some captured
134    packets. */
135 void set_menus_for_captured_packets(gboolean);
136
137 /* Enable or disable menu items based on whether a packet is selected. */
138 void set_menus_for_selected_packet(capture_file *cf);
139
140
141 #ifdef __cplusplus
142 }
143 #endif /* __cplusplus */
144
145 #endif /* __MAIN_MENU_H__ */