Replace a handful of tabs with spaces.
[obnox/wireshark/wip.git] / gtk / expert_comp_table.h
1 /* expert_comp_table.h
2  * expert_comp_table   2005 Greg Morris
3  * Portions copied from service_response_time_table.h by Ronnie Sahlberg 
4  * Helper routines common to all composite expert statistics
5  * tap.
6  *
7  * $Id$
8  *
9  * Wireshark - Network traffic analyzer
10  * By Gerald Combs <gerald@wireshark.org>
11  * Copyright 1998 Gerald Combs
12  * 
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  * 
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  * 
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26  */
27
28 #include <gtk/gtk.h>
29 #include <epan/expert.h>
30
31 /** @file
32  *  Helper routines common to all error statistics tap.
33  */
34
35 /** Procedure data */
36 typedef struct _error_procedure_t {
37         char    *entries[4];       /**< column entries */
38     char    *fvalue_value;     /**< filter value */
39 #if (GTK_MAJOR_VERSION < 2)
40         guint32 packet_num;        /**< first packet number */
41 #else
42     GtkTreeIter      iter;
43 #endif
44     guint16 count;             /**< number of expert items encountered
45                                     for this entry */
46 } error_procedure_t;
47
48 /** Statistics table */
49 typedef struct _error_equiv_table {
50         GtkWidget *scrolled_window;         /**< window widget */
51 #if (GTK_MAJOR_VERSION < 2)
52     GtkCList *table;                    /**< table widget */
53 #else
54     GtkTreeSelection *select;           /**< item selected */
55     GtkTreeView      *tree_view;        /**< Tree view */
56 #endif
57         GtkWidget *menu;                    /**< context menu */
58         guint16 num_procs;                  /**< number of elements on procedures array */
59         error_procedure_t *procedures;      /**< the procedures array */
60 }error_equiv_table;
61
62 typedef struct _expert_tapdata_s {
63         GtkWidget       *win;
64         GtkWidget       *scrolled_window;
65         GtkCList        *table;
66         GtkWidget       *label;
67         GList           *all_events;
68         GList           *new_events;
69         guint32         disp_events;
70         guint32         chat_events;
71         guint32         note_events;
72         guint32         warn_events;
73         guint32         error_events;
74         int                     severity_report_level;
75 } expert_tapdata_t;
76
77 /** Init an err table data structure.
78  *
79  * @param err the err table to init
80  * @param num_procs number of procedures
81  * @param vbox the corresponding GtkVBox to fill in
82  */
83 void init_error_table(error_equiv_table *err, guint16 num_procs, GtkWidget *vbox);
84
85 /** Init an err table row data structure.
86  *
87  * @param err the err table
88  * @param expert data
89  */
90 void init_error_table_row(error_equiv_table *err, const expert_info_t *expert_data);
91
92 /** Add err response to table row data. This will not draw the data!
93  *
94  * @param err the err table
95  * @param expert data
96  */
97 void add_error_table_data(error_equiv_table *err, const expert_info_t *expert_data);
98
99 /** Draw the err table data.
100  *
101  * @param err the err table
102  */
103 void draw_error_table_data(error_equiv_table *err);
104
105 /** Reset the err table data.
106  *
107  * @param err the err table
108  */
109 void reset_error_table_data(error_equiv_table *err);
110
111 /** Free the err table data.
112  *
113  * @param err the err table
114  */
115 void free_error_table_data(error_equiv_table *err);
116
117 /* Function is located in expert_dlg.c */
118 extern void expert_dlg_init_table(expert_tapdata_t * etd, GtkWidget *vbox);
119 extern void expert_dlg_reset(void *tapdata);
120 extern int expert_dlg_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pointer);
121 extern void expert_dlg_draw(void *data);