2004-01-19 00:42:12 +00:00
|
|
|
/* recent.h
|
|
|
|
* Definitions for recent "preference" handling routines
|
|
|
|
* Copyright 2004, Ulf Lamping <ulf.lamping@web.de>
|
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-01-19 00:42:12 +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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2004-01-19 00:42:12 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __RECENT_H__
|
|
|
|
#define __RECENT_H__
|
|
|
|
|
2011-12-29 00:08:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2004-01-19 00:42:12 +00:00
|
|
|
#include <glib.h>
|
|
|
|
|
2012-12-29 01:39:02 +00:00
|
|
|
#include "epan/timestamp.h"
|
2013-02-02 05:34:31 +00:00
|
|
|
#include "ui/ui_util.h"
|
2012-12-29 01:39:02 +00:00
|
|
|
|
2004-06-02 22:13:04 +00:00
|
|
|
/** @file
|
|
|
|
* Recent user interface settings.
|
2004-06-04 17:19:01 +00:00
|
|
|
* @ingroup main_window_group
|
2004-06-02 22:13:04 +00:00
|
|
|
*/
|
2004-01-19 00:42:12 +00:00
|
|
|
|
2004-06-02 22:13:04 +00:00
|
|
|
/** ???. */
|
2004-01-19 00:42:12 +00:00
|
|
|
#define RECENT_KEY_CAPTURE_FILE "recent.capture_file"
|
2004-06-02 22:13:04 +00:00
|
|
|
|
|
|
|
/** ???. */
|
2004-01-19 00:42:12 +00:00
|
|
|
#define RECENT_KEY_DISPLAY_FILTER "recent.display_filter"
|
|
|
|
|
2012-01-18 19:38:34 +00:00
|
|
|
#define RECENT_KEY_COL_WIDTH "column.width"
|
|
|
|
|
|
|
|
#define RECENT_KEY_CAPTURE_FILTER "recent.capture_filter"
|
|
|
|
|
|
|
|
#define RECENT_KEY_REMOTE_HOST "recent.remote_host"
|
|
|
|
|
2008-04-12 19:37:05 +00:00
|
|
|
typedef struct _col_width_data {
|
|
|
|
gint cfmt;
|
|
|
|
gchar *cfield;
|
|
|
|
gint width;
|
2009-12-01 17:07:13 +00:00
|
|
|
gchar xalign;
|
2008-04-12 19:37:05 +00:00
|
|
|
} col_width_data;
|
|
|
|
|
2009-12-09 15:48:38 +00:00
|
|
|
/** Defines used in col_width_data.xalign */
|
|
|
|
#define COLUMN_XALIGN_DEFAULT 0
|
|
|
|
#define COLUMN_XALIGN_LEFT 'L'
|
|
|
|
#define COLUMN_XALIGN_CENTER 'C'
|
|
|
|
#define COLUMN_XALIGN_RIGHT 'R'
|
|
|
|
|
2004-06-02 22:13:04 +00:00
|
|
|
/** Recent settings. */
|
2004-01-19 00:42:12 +00:00
|
|
|
typedef struct recent_settings_tag {
|
|
|
|
gboolean main_toolbar_show;
|
|
|
|
gboolean filter_toolbar_show;
|
2012-06-19 12:42:06 +00:00
|
|
|
gboolean wireless_toolbar_show;
|
2007-08-30 00:24:40 +00:00
|
|
|
gboolean airpcap_driver_check_show;
|
2004-01-19 00:42:12 +00:00
|
|
|
gboolean packet_list_show;
|
|
|
|
gboolean tree_view_show;
|
|
|
|
gboolean byte_view_show;
|
|
|
|
gboolean statusbar_show;
|
2005-03-27 02:19:51 +00:00
|
|
|
gboolean packet_list_colorize;
|
2012-12-29 01:39:02 +00:00
|
|
|
ts_type gui_time_format;
|
2005-08-25 21:29:54 +00:00
|
|
|
gint gui_time_precision;
|
2012-12-29 01:39:02 +00:00
|
|
|
ts_seconds_type gui_seconds_format;
|
2004-01-20 18:47:25 +00:00
|
|
|
gint gui_zoom_level;
|
2009-11-05 10:16:49 +00:00
|
|
|
gint gui_bytes_view;
|
2004-02-01 20:28:11 +00:00
|
|
|
|
|
|
|
gint gui_geometry_main_x;
|
|
|
|
gint gui_geometry_main_y;
|
|
|
|
gint gui_geometry_main_width;
|
|
|
|
gint gui_geometry_main_height;
|
|
|
|
|
2008-04-12 19:37:05 +00:00
|
|
|
gboolean gui_geometry_main_maximized;
|
2004-04-25 23:45:12 +00:00
|
|
|
|
2005-05-30 04:06:22 +00:00
|
|
|
gboolean has_gui_geometry_main_upper_pane; /* gui_geometry_main_upper_pane is valid */
|
2008-04-12 19:37:05 +00:00
|
|
|
gint gui_geometry_main_upper_pane;
|
2005-05-30 04:06:22 +00:00
|
|
|
gboolean has_gui_geometry_main_lower_pane; /* gui_geometry_main_lower_pane is valid */
|
2008-04-12 19:37:05 +00:00
|
|
|
gint gui_geometry_main_lower_pane;
|
2005-05-30 04:06:22 +00:00
|
|
|
gboolean has_gui_geometry_status_pane; /* gui_geometry_status_pane is valid */
|
2008-04-12 19:37:05 +00:00
|
|
|
gint gui_geometry_status_pane_left;
|
|
|
|
gint gui_geometry_status_pane_right;
|
2008-05-11 18:03:22 +00:00
|
|
|
gint gui_geometry_wlan_stats_pane;
|
2007-08-30 00:24:40 +00:00
|
|
|
gboolean privs_warn_if_elevated;
|
2007-09-15 00:18:17 +00:00
|
|
|
gboolean privs_warn_if_no_npf;
|
2008-04-12 19:37:05 +00:00
|
|
|
GList *col_width_list; /* column widths */
|
2011-12-29 00:08:47 +00:00
|
|
|
gchar *gui_fileopen_remembered_dir; /* folder of last capture loaded in File Open dialog */
|
2004-01-19 00:42:12 +00:00
|
|
|
} recent_settings_t;
|
|
|
|
|
2004-06-02 22:13:04 +00:00
|
|
|
/** Global recent settings. */
|
2004-01-19 00:42:12 +00:00
|
|
|
extern recent_settings_t recent;
|
|
|
|
|
2004-06-02 22:13:04 +00:00
|
|
|
/** Write recent settings file.
|
|
|
|
*
|
2005-03-26 01:05:29 +00:00
|
|
|
* @return TRUE if succeeded, FALSE if failed
|
2004-06-02 22:13:04 +00:00
|
|
|
*/
|
2005-03-26 01:05:29 +00:00
|
|
|
extern gboolean write_recent(void);
|
2004-01-19 00:42:12 +00:00
|
|
|
|
2008-04-28 12:35:03 +00:00
|
|
|
/** Write profile recent settings file.
|
|
|
|
*
|
|
|
|
* @return TRUE if succeeded, FALSE if failed
|
|
|
|
*/
|
|
|
|
extern gboolean write_profile_recent(void);
|
|
|
|
|
2005-05-30 04:06:22 +00:00
|
|
|
/** Read recent settings file (static part).
|
2004-06-02 22:13:04 +00:00
|
|
|
*
|
|
|
|
* @param rf_path_return path to recent file if function failed
|
|
|
|
* @param rf_errno_return if failed
|
|
|
|
*/
|
2005-05-30 04:06:22 +00:00
|
|
|
extern void recent_read_static(char **rf_path_return, int *rf_errno_return);
|
|
|
|
|
2008-04-28 12:35:03 +00:00
|
|
|
/** Read profile recent settings file (static part).
|
|
|
|
*
|
|
|
|
* @param rf_path_return path to recent file if function failed
|
|
|
|
* @param rf_errno_return if failed
|
|
|
|
*/
|
|
|
|
extern void recent_read_profile_static(char **rf_path_return, int *rf_errno_return);
|
|
|
|
|
2005-05-30 04:06:22 +00:00
|
|
|
/** Read recent settings file (dynamic part).
|
|
|
|
*
|
|
|
|
* @param rf_path_return path to recent file if function failed
|
|
|
|
* @param rf_errno_return if failed
|
|
|
|
*/
|
|
|
|
extern void recent_read_dynamic(char **rf_path_return, int *rf_errno_return);
|
2004-01-19 00:42:12 +00:00
|
|
|
|
2005-05-30 04:06:22 +00:00
|
|
|
/**
|
|
|
|
* Given a -o command line string, parse it and set the recent value in
|
|
|
|
* question. Return an indication of whether it succeeded or failed
|
|
|
|
* in some fashion.
|
|
|
|
*
|
2005-07-19 20:46:38 +00:00
|
|
|
* @param prefarg a string of the form "<recent name>:<recent value>", as might appear
|
2005-05-30 04:06:22 +00:00
|
|
|
* as an argument to a "-o" command line option
|
|
|
|
* @return PREFS_SET_OK or PREFS_SET_SYNTAX_ERR
|
|
|
|
*/
|
|
|
|
extern int recent_set_arg(char *prefarg);
|
|
|
|
|
2008-04-12 19:37:05 +00:00
|
|
|
/** Get the column width for the given column
|
2011-12-29 00:08:47 +00:00
|
|
|
*
|
2008-04-12 19:37:05 +00:00
|
|
|
* @param col column number
|
|
|
|
*/
|
|
|
|
extern gint recent_get_column_width(gint col);
|
|
|
|
|
2008-06-14 16:45:06 +00:00
|
|
|
/** Set the column width for the given column
|
2011-12-29 00:08:47 +00:00
|
|
|
*
|
2008-06-14 16:45:06 +00:00
|
|
|
* @param col column number
|
|
|
|
* @param width column width
|
|
|
|
*/
|
|
|
|
extern void recent_set_column_width(gint col, gint width);
|
|
|
|
|
2009-12-01 17:07:13 +00:00
|
|
|
/** Get the column xalign for the given column
|
2011-12-29 00:08:47 +00:00
|
|
|
*
|
2009-12-01 17:07:13 +00:00
|
|
|
* @param col column number
|
|
|
|
*/
|
|
|
|
extern gchar recent_get_column_xalign(gint col);
|
|
|
|
|
|
|
|
/** Set the column xalign for the given column
|
|
|
|
*
|
|
|
|
* @param col column number
|
|
|
|
* @param xalign column alignment
|
|
|
|
*/
|
|
|
|
extern void recent_set_column_xalign(gint col, gchar xalign);
|
|
|
|
|
2013-02-02 05:34:31 +00:00
|
|
|
/* save the window and its current geometry into the geometry hashtable */
|
|
|
|
extern void window_geom_save(const gchar *name, window_geometry_t *geom);
|
|
|
|
|
|
|
|
/* load the desired geometry for this window from the geometry hashtable */
|
|
|
|
extern gboolean window_geom_load(const gchar *name, window_geometry_t *geom);
|
|
|
|
|
2013-07-27 22:37:26 +00:00
|
|
|
/**
|
|
|
|
* Returns a list of recent capture filters.
|
|
|
|
*
|
|
|
|
* @param ifname interface name; NULL refers to the global list.
|
|
|
|
*/
|
|
|
|
extern GList *recent_get_cfilter_list(const gchar *ifname);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a capture filter to the global recent capture filter list or
|
|
|
|
* the recent capture filter list for an interface.
|
|
|
|
*
|
|
|
|
* @param ifname interface name; NULL refers to the global list.
|
|
|
|
* @param s text of capture filter
|
|
|
|
*/
|
|
|
|
extern void recent_add_cfilter(const gchar *ifname, const gchar *s);
|
|
|
|
|
2011-12-29 00:08:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2004-01-19 00:42:12 +00:00
|
|
|
#endif /* recent.h */
|
2012-10-24 15:52:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|