Be a little more explicit in our description of tvb_get_ptr.
[metze/wireshark/wip.git] / gtk / recent.h
1 /* recent.h
2  * Definitions for recent "preference" handling routines
3  * Copyright 2004, Ulf Lamping <ulf.lamping@web.de>
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
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 #ifndef __RECENT_H__
27 #define __RECENT_H__
28
29 #include <glib.h>
30
31 /** @file
32  *  Recent user interface settings.
33  *  @ingroup main_window_group
34  */
35
36 /** ???. */
37 #define RECENT_KEY_CAPTURE_FILE         "recent.capture_file"
38
39 /** ???. */
40 #define RECENT_KEY_DISPLAY_FILTER       "recent.display_filter"
41
42 typedef struct _col_width_data {
43   gint   cfmt;
44   gchar *cfield;
45   gint   width;
46 } col_width_data;
47
48 /** Recent settings. */
49 typedef struct recent_settings_tag {
50     gboolean    main_toolbar_show;
51     gboolean    filter_toolbar_show;
52     gboolean    airpcap_toolbar_show;
53     gboolean    airpcap_driver_check_show;
54     gboolean    packet_list_show;
55     gboolean    tree_view_show;
56     gboolean    byte_view_show;
57     gboolean    statusbar_show;
58     gboolean    packet_list_colorize;
59     gint        gui_time_format;
60     gint        gui_time_precision;
61     gint        gui_zoom_level;
62
63     gint        gui_geometry_main_x;
64     gint        gui_geometry_main_y;
65     gint        gui_geometry_main_width;
66     gint        gui_geometry_main_height;
67
68     gboolean    gui_geometry_main_maximized;
69
70     gboolean    has_gui_geometry_main_upper_pane;   /* gui_geometry_main_upper_pane is valid */
71     gint        gui_geometry_main_upper_pane;
72     gboolean    has_gui_geometry_main_lower_pane;   /* gui_geometry_main_lower_pane is valid */
73     gint        gui_geometry_main_lower_pane;
74     gboolean    has_gui_geometry_status_pane;       /* gui_geometry_status_pane is valid */
75     gint        gui_geometry_status_pane_left;
76     gint        gui_geometry_status_pane_right;
77     gint        gui_geometry_wlan_stats_pane;
78     gboolean    privs_warn_if_elevated;
79     gboolean    privs_warn_if_no_npf;
80     GList      *col_width_list;                     /* column widths */
81 } recent_settings_t;
82
83 /** Global recent settings. */
84 extern recent_settings_t recent;
85
86 /** Write recent settings file.
87  *
88  * @return TRUE if succeeded, FALSE if failed
89  */
90 extern gboolean write_recent(void);
91
92 /** Write profile recent settings file.
93  *
94  * @return TRUE if succeeded, FALSE if failed
95  */
96 extern gboolean write_profile_recent(void);
97
98 /** Read recent settings file (static part).
99  *
100  * @param rf_path_return path to recent file if function failed
101  * @param rf_errno_return if failed
102  */
103 extern void recent_read_static(char **rf_path_return, int *rf_errno_return);
104
105 /** Read profile recent settings file (static part).
106  *
107  * @param rf_path_return path to recent file if function failed
108  * @param rf_errno_return if failed
109  */
110 extern void recent_read_profile_static(char **rf_path_return, int *rf_errno_return);
111
112 /** Read recent settings file (dynamic part).
113  *
114  * @param rf_path_return path to recent file if function failed
115  * @param rf_errno_return if failed
116  */
117 extern void recent_read_dynamic(char **rf_path_return, int *rf_errno_return);
118
119 /** Write the geometry values of a single window to the recent file.
120  *
121  * @param key unused
122  * @param value the geometry values
123  * @param rf recent file handle (FILE)
124  */
125 extern void write_recent_geom(gpointer key, gpointer value, gpointer rf);
126
127 /**
128  * Given a -o command line string, parse it and set the recent value in
129  * question.  Return an indication of whether it succeeded or failed
130  * in some fashion.
131  *
132  * @param prefarg a string of the form "<recent name>:<recent value>", as might appear
133  * as an argument to a "-o" command line option
134  * @return PREFS_SET_OK or PREFS_SET_SYNTAX_ERR
135  */
136 extern int recent_set_arg(char *prefarg);
137
138 /** Get the column width for the given column
139  * 
140  * @param col column number
141  */
142 extern gint recent_get_column_width(gint col);
143
144 /** Set the column width for the given column
145  * 
146  * @param col column number
147  * @param width column width
148  */
149 extern void recent_set_column_width(gint col, gint width);
150
151 #endif /* recent.h */