There's no need to keep a "FILE *" for the file being printed to in a
[obnox/wireshark/wip.git] / tap_dfilter_dlg.h
1 /* tap_dfilter_dlg.h
2  * Header file for display filter dialog used by gui taps
3  * Copyright 2003 Lars Roland
4  *
5  * $Id: tap_dfilter_dlg.h,v 1.1 2003/12/19 23:39:53 guy Exp $
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 /*
27  * You can easily add a display filter dialog for your gui tap by using 
28  * the following infrastructure:
29  *
30  * Define a global structure of tap_dfilter_dlg within your tap source file.
31  * Initiate it with:
32  * 1) a title string for the Dialog Window
33  * 2) the init string, which is the same as the string after "-z" option without 
34  *    the filter string and without the seperating comma.
35  * 3) a pointer to the init function of the tap, which will be called when you click
36  *    on the start button in the display filter dialog.
37  * 4) the index with "-1"
38  *
39  * Within register_tap_menu_yourtap(void), call register_tap_menu_item() with gtk_tap_dfilter_dlg_cb as callback and a pointer 
40  * to the global tap_dfilter_dlg structure .
41  *
42  * Usage:
43  *
44  * tap_dfilter_dlg my_tap_dfilter_dlg = {"My Title", "myproto,mytap", gtk_mytap_init, -1};
45  *
46  * register_tap_menu_mytap(void) {
47  *   register_tap_menu_item(char *menu_string, gtk_tap_dfilter_dlg_cb, NULL, NULL, &(my_tap_dfilter_dlg));
48  * }
49  *
50  * See also: h225_ras_srt.c or h225_counter.c
51  *
52  */
53
54 typedef struct _tap_dfilter_dlg {
55         char *win_title;        /* title */
56         char *init_string;      /* the string to call the tap without a filter via "-z" option */
57         void (* tap_init_cb)(char *);   /* callback to init function of the tap */
58         gint index;             /* initiate this value always with "-1" */
59 } tap_dfilter_dlg;
60
61 /* This will update the titles of the dialog windows when we load a new capture file. */
62 void tap_dfilter_dlg_update (void);