I have to check this in with HHC enabled, otherwise I cannot get a chm file without...
[obnox/wireshark/wip.git] / color_filters.h
1 /* color_filters.h
2  * Definitions for color filters
3  *
4  * $Id$
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@ethereal.com>
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 #ifndef  __COLOR_FILTERS_H__
25 #define  __COLOR_FILTERS_H__
26
27 /** @file
28  *  Color filters.
29  */
30
31 /* Data for a color filter. */
32 typedef struct _color_filter {
33         gchar     *filter_name;   /* name of the filter */
34         gchar     *filter_text;   /* text of the filter expression */
35         color_t    bg_color;      /* background color for packets that match */
36         color_t    fg_color;      /* foreground color for packets that match */
37         dfilter_t *c_colorfilter; /* compiled filter expression */
38         void      *edit_dialog;   /* if filter is being edited, dialog
39                                    * box for it */
40         gboolean    marked;         /* set if the filter is marked in the color dialog box */
41 } color_filter_t;
42
43 /* List of all color filters. */
44 extern GSList *filter_list;
45 extern GSList *removed_filter_list;
46
47 /** Init the color filters. */
48 void colfilter_init(void);
49
50 /** Save filters in users filter file.
51  *
52  * @return TRUE if write succeeded
53  */
54 gboolean write_filters(void);
55
56 /** Delete users filter file and reload global filters.
57  *
58  * @return TRUE if write succeeded
59  */
60 gboolean revert_filters(void);
61
62 /** Create a new color filter.
63  *
64  * @param name the name of the filter
65  * @param filter_string the filter string
66  * @param bg_color background color
67  * @param fg_color foreground color
68  * @return the new color filter
69  */
70 color_filter_t *new_color_filter(gchar *name, gchar *filter_string,
71     color_t *bg_color, color_t *fg_color);
72
73 /** Remove the color filter.
74  *
75  * @param colorf the color filter to be removed
76  */
77 void remove_color_filter(color_filter_t *colorf);
78
79 /** Load filters from some other filter file.
80  *
81  * @param path the path to the filter file
82  * @param arg the color filter widget
83  * @return TRUE, if read succeeded
84  */
85 gboolean read_other_filters(gchar *path, gpointer arg);
86
87 /** Save filters to some other filter file.
88  *
89  * @param path the path to the filter file
90  * @param only_marked TRUE if only the marked filters should be saved
91  * @return TRUE, if write succeeded
92  */
93 gboolean write_other_filters(gchar *path, gboolean only_marked);
94
95 /** Add a color filter.
96  *
97  * @param colorf the new color filter
98  * @param arg the color filter widget
99  */
100 void color_add_filter_cb (color_filter_t *colorf, gpointer arg);
101
102 void filter_list_prime_edt(epan_dissect_t *edt);
103
104 #endif