radiotap: Updates to the radiotap dissector to avoid confusion.
[metze/wireshark/wip.git] / epan / funnel.h
1 /*
2  *  funnel.h
3  *
4  * EPAN's GUI mini-API
5  *
6  * (c) 2006, Luis E. Garcia Ontanon <luis@ontanon.org>
7  *
8  * Wireshark - Network traffic analyzer
9  * By Gerald Combs <gerald@wireshark.org>
10  * Copyright 1998 Gerald Combs
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  */
26 #ifndef __FUNNEL_H__
27 #define __FUNNEL_H__
28
29 #include <glib.h>
30 #include <epan/stat_groups.h>
31 #include "ws_symbol_export.h"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36
37 typedef struct _funnel_ops_id_t funnel_ops_id_t; /* Opaque pointer to ops instance */
38 typedef struct _funnel_progress_window_t funnel_progress_window_t ;
39 typedef struct _funnel_text_window_t funnel_text_window_t ;
40 typedef struct _funnel_tree_window_t funnel_tree_window_t ; /* XXX Unused? */
41 typedef struct _funnel_node_t funnel_node_t ; /* XXX Unused? */
42
43 typedef void (*text_win_close_cb_t)(void*);
44
45 typedef void (*funnel_dlg_cb_t)(gchar** user_input, void* data);
46
47 typedef gboolean (*funnel_bt_cb_t)(funnel_text_window_t* tw, void* data);
48
49 typedef void (* funnel_menu_callback)(gpointer);
50
51 typedef struct _funnel_bt_t {
52         funnel_text_window_t* tw;
53         funnel_bt_cb_t func;
54         void* data;
55         void (*free_fcn)(void*);
56         void (*free_data_fcn)(void*);
57 } funnel_bt_t;
58
59 struct progdlg;
60
61 typedef struct _funnel_ops_t {
62     funnel_ops_id_t *ops_id;
63     funnel_text_window_t* (*new_text_window)(const char* label);
64     void (*set_text)(funnel_text_window_t*  win, const char* text);
65     void (*append_text)(funnel_text_window_t*  win, const char* text);
66     void (*prepend_text)(funnel_text_window_t*  win, const char* text);
67     void (*clear_text)(funnel_text_window_t*  win);
68     const char* (*get_text)(funnel_text_window_t*  win);
69     void (*set_close_cb)(funnel_text_window_t*  win, text_win_close_cb_t cb, void* data);
70     void (*set_editable)(funnel_text_window_t*  win, gboolean editable);
71     void (*destroy_text_window)(funnel_text_window_t*  win);
72     void (*add_button)(funnel_text_window_t*  win, funnel_bt_t* cb, const char* label);
73
74     void (*new_dialog)(const gchar* title,
75                        const gchar** fieldnames,
76                        funnel_dlg_cb_t dlg_cb,
77                        void* data);
78
79     void (*close_dialogs)(void);
80
81     void (*logger)(const gchar *log_domain,
82                    GLogLevelFlags log_level,
83                    const gchar *message,
84                    gpointer user_data);
85
86
87     void (*retap_packets)(funnel_ops_id_t *ops_id);
88     void (*copy_to_clipboard)(GString *str);
89
90     const gchar * (*get_filter)(funnel_ops_id_t *ops_id);
91     void (*set_filter)(funnel_ops_id_t *ops_id, const char* filter);
92     void (*set_color_filter_slot)(guint8 flit_nr, const gchar* filter);
93     gboolean (*open_file)(funnel_ops_id_t *ops_id, const char* fname, const char* filter, char** error);
94     void (*reload_packets)(funnel_ops_id_t *ops_id);
95     void (*reload_lua_plugins)(funnel_ops_id_t *ops_id);
96     void (*apply_filter)(funnel_ops_id_t *ops_id);
97
98     gboolean (*browser_open_url)(const gchar *url);
99     void (*browser_open_data_file)(const gchar *filename);
100
101     struct progdlg* (*new_progress_window)(funnel_ops_id_t *ops_id, const gchar* label, const gchar* task, gboolean terminate_is_stop, gboolean *stop_flag);
102     void (*update_progress)(struct progdlg*, float pr, const gchar* task);
103     void (*destroy_progress_window)(struct progdlg*);
104 } funnel_ops_t;
105
106 WS_DLL_PUBLIC const funnel_ops_t* funnel_get_funnel_ops(void);
107 WS_DLL_PUBLIC void funnel_set_funnel_ops(const funnel_ops_t*);
108
109 WS_DLL_PUBLIC void funnel_register_menu(const char *name,
110                                  register_stat_group_t group,
111                                  funnel_menu_callback callback,
112                                  gpointer callback_data,
113                                  gboolean retap);
114 void funnel_deregister_menus(void (*callback)(gpointer));
115
116 typedef void (*funnel_registration_cb_t)(const char *name,
117                                          register_stat_group_t group,
118                                          funnel_menu_callback callback,
119                                          gpointer callback_data,
120                                          gboolean retap);
121 typedef void (*funnel_deregistration_cb_t)(funnel_menu_callback callback);
122
123 WS_DLL_PUBLIC void funnel_register_all_menus(funnel_registration_cb_t r_cb);
124 WS_DLL_PUBLIC void funnel_reload_menus(funnel_deregistration_cb_t d_cb,
125                                        funnel_registration_cb_t r_cb);
126
127 extern void initialize_funnel_ops(void);
128
129 extern void funnel_dump_all_text_windows(void);
130
131 #ifdef __cplusplus
132 }
133 #endif /* __cplusplus */
134
135 #endif /* __FUNNEL_H__ */