2004-07-19 23:17:20 +00:00
|
|
|
/* filter_dlg.h
|
2000-02-12 06:46:54 +00:00
|
|
|
* Definitions for dialog boxes for filter editing
|
1998-09-16 02:39:15 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1998-09-16 03:22:19 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1998-09-16 02:39:15 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2008-01-08 23:14:13 +00:00
|
|
|
#ifndef __FILTER_DLG_H__
|
|
|
|
#define __FILTER_DLG_H__
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** @file
|
|
|
|
* "Capture Filter" / "Display Filter" / "Add expression" dialog boxes.
|
|
|
|
* (This used to be a notebook page under "Preferences", hence the
|
|
|
|
* "prefs" in the file name.)
|
2004-06-04 20:05:31 +00:00
|
|
|
* @ingroup dialog_group
|
2004-06-01 17:33:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
In the process of destroying a filter editing dialog box, we get a
selection change event on the list of filters. Unfortunately, this can
happen after some other widgets in that dialog box have already been
destroyed - including some of the widgets that such a selection change
event can change.
This sometimes happened when "filter_prefs_delete()" hadn't been called,
so the mechanism we had been using, with a Boolean datum attached to the
dialog box, set in "filter_prefs_delete()" before we actually destroy
the dialog box, wasn't sufficient to keep that from happening.
Attach to the top-level window data items containing pointers to the
widgets changed when a filter is selected from the list, give each of
those widgets their own destroy callbacks, clear the pointer attached to
the top-level widget when the widget is destroyed, and don't do anything
to the widget when a filter is selected from the list if the pointer for
that widget is null, as that means the widget's been destroyed and we
*can't* do anything to it.
Not all filter editing dialogs created on behalf of a "Filter:" button
next to a text entry box should, when you click "OK", activate the text
entry box; if the text entry box is part of a dialog box with multiple
widgets, the user might not have filled in all of the items in that
dialog box, so you shouldn't activate it for them. Add a mechanism by
which, when creating a filter editing dialog box, you can specify
whether the "OK" button should just fill in the text entry box or should
fill it in and also activate it.
svn path=/trunk/; revision=2922
2001-01-21 01:45:07 +00:00
|
|
|
* Structure giving properties of the filter editing dialog box to be
|
|
|
|
* created.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
2005-08-05 20:59:08 +00:00
|
|
|
const gchar *title; /**< title of dialog box */
|
2004-06-01 17:33:37 +00:00
|
|
|
gboolean wants_apply_button; /**< dialog should have an Apply button */
|
|
|
|
gboolean activate_on_ok; /**< if parent text widget should be
|
|
|
|
activated on "Ok" or "Apply" */
|
2005-12-31 17:09:27 +00:00
|
|
|
gboolean modal_and_transient; /**< dialog is modal and transient to the
|
|
|
|
parent window (e.g. to gtk_file_chooser) */
|
In the process of destroying a filter editing dialog box, we get a
selection change event on the list of filters. Unfortunately, this can
happen after some other widgets in that dialog box have already been
destroyed - including some of the widgets that such a selection change
event can change.
This sometimes happened when "filter_prefs_delete()" hadn't been called,
so the mechanism we had been using, with a Boolean datum attached to the
dialog box, set in "filter_prefs_delete()" before we actually destroy
the dialog box, wasn't sufficient to keep that from happening.
Attach to the top-level window data items containing pointers to the
widgets changed when a filter is selected from the list, give each of
those widgets their own destroy callbacks, clear the pointer attached to
the top-level widget when the widget is destroyed, and don't do anything
to the widget when a filter is selected from the list if the pointer for
that widget is null, as that means the widget's been destroyed and we
*can't* do anything to it.
Not all filter editing dialogs created on behalf of a "Filter:" button
next to a text entry box should, when you click "OK", activate the text
entry box; if the text entry box is part of a dialog box with multiple
widgets, the user might not have filled in all of the items in that
dialog box, so you shouldn't activate it for them. Add a mechanism by
which, when creating a filter editing dialog box, you can specify
whether the "OK" button should just fill in the text entry box or should
fill it in and also activate it.
svn path=/trunk/; revision=2922
2001-01-21 01:45:07 +00:00
|
|
|
} construct_args_t;
|
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** Create a "Capture Filter" dialog box caused by a button click.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param user_data unused
|
|
|
|
*/
|
|
|
|
void capture_filter_construct_cb(GtkWidget *widget, gpointer user_data);
|
|
|
|
|
|
|
|
/** Create a "Display Filter" dialog box caused by a button click.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param construct_args_ptr parameters to construct the dialog (construct_args_t)
|
|
|
|
*/
|
|
|
|
void display_filter_construct_cb(GtkWidget *widget, gpointer construct_args_ptr);
|
|
|
|
|
|
|
|
/** Should be called when the widget (usually a button) that creates filters
|
|
|
|
* is destroyed. It destroys any filter dialog created by that widget.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param user_data unused
|
|
|
|
*/
|
|
|
|
void filter_button_destroy_cb(GtkWidget *widget, gpointer user_data);
|
|
|
|
|
|
|
|
/** User requested the "Capture Filter" dialog box by menu or toolbar.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
*/
|
|
|
|
void cfilter_dialog_cb(GtkWidget *widget);
|
|
|
|
|
|
|
|
/** User requested the "Display Filter" dialog box by menu or toolbar.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
*/
|
|
|
|
void dfilter_dialog_cb(GtkWidget *widget);
|
|
|
|
|
|
|
|
/** Create an "Add expression" dialog box caused by a button click.
|
|
|
|
*
|
|
|
|
* @param widget unused
|
|
|
|
* @param main_w_arg parent widget
|
|
|
|
*/
|
|
|
|
void filter_add_expr_bt_cb(GtkWidget *widget, gpointer main_w_arg);
|
2000-02-12 06:46:54 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** Colorize a text entry as empty.
|
|
|
|
*
|
|
|
|
* @param widget the text entry to colorize
|
|
|
|
*/
|
|
|
|
void colorize_filter_te_as_empty(GtkWidget *widget);
|
|
|
|
|
|
|
|
/** Colorize a text entry as a invalid.
|
|
|
|
*
|
|
|
|
* @param widget the text entry to colorize
|
|
|
|
*/
|
|
|
|
void colorize_filter_te_as_invalid(GtkWidget *widget);
|
2004-01-25 15:10:36 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** Colorize a text entry as a valid.
|
|
|
|
*
|
|
|
|
* @param widget the text entry to colorize
|
|
|
|
*/
|
|
|
|
void colorize_filter_te_as_valid(GtkWidget *widget);
|
|
|
|
|
|
|
|
/** Colorize a filter text entry depending on "validity".
|
|
|
|
*
|
|
|
|
* @param widget the text entry to colorize
|
|
|
|
*/
|
|
|
|
void filter_te_syntax_check_cb(GtkWidget *widget);
|
|
|
|
|
2004-06-05 12:12:13 +00:00
|
|
|
/** The filter button of the top_level window. */
|
2004-01-25 15:10:36 +00:00
|
|
|
#define E_FILT_BT_PTR_KEY "filter_bt_ptr"
|
2004-06-01 17:33:37 +00:00
|
|
|
|
2004-06-05 12:12:13 +00:00
|
|
|
/** The filter text entry. */
|
2004-01-25 15:10:36 +00:00
|
|
|
#define E_FILT_TE_PTR_KEY "filter_te_ptr"
|
2004-06-01 17:33:37 +00:00
|
|
|
|
2004-06-05 12:12:13 +00:00
|
|
|
/** The filter text entry.
|
|
|
|
* @todo Check the usage of all the text entry keys.
|
|
|
|
*/
|
2004-01-25 15:10:36 +00:00
|
|
|
#define E_FILT_FILTER_TE_KEY "filter_filter_te"
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2008-11-27 09:33:17 +00:00
|
|
|
/** Only validate a single field entry. */
|
2008-10-10 17:00:38 +00:00
|
|
|
#define E_FILT_FIELD_NAME_ONLY_KEY "filter_field_name_only"
|
|
|
|
|
2008-10-23 14:30:35 +00:00
|
|
|
/** Update statusbar when changing the filter entry. */
|
|
|
|
#define E_FILT_FIELD_USE_STATUSBAR_KEY "filter_field_use_statusbar"
|
|
|
|
|
2008-01-08 23:14:13 +00:00
|
|
|
#endif /* filter_dlg.h */
|