Clear up the code.
[obnox/wireshark/wip.git] / epan / prefs.h
index fe3f2e1a35e53515a9bbfcafb81dee5a250aa079..07760a3745e28cb85eacc9ab8ee03703ec397f30 100644 (file)
 
 #define MAX_VAL_LEN  1024
 
-/* only GTK1 *or* GTK2 font_name should be used */
-/* (we need to keep both in the preferences file but will only use the one suitable for the programs GTK version used) */
-#if GTK_MAJOR_VERSION < 2
-#define PREFS_GUI_FONT_NAME gui_font_name1
-#else
-#define PREFS_GUI_FONT_NAME gui_font_name2
-#endif
+#define RTP_PLAYER_DEFAULT_VISIBLE 4
+#define TAP_UPDATE_DEFAULT_INTERVAL 3000
 
 /*
  * Convert a string listing name resolution types to a bitmask of
@@ -120,8 +115,7 @@ typedef struct _e_prefs {
   gint     gui_ptree_expander_style;
   gboolean gui_hex_dump_highlight_style;
   gint     gui_toolbar_main_style;
-  gchar   *gui_font_name1;
-  gchar   *gui_font_name2;
+  gchar   *gui_font_name;
   color_t  gui_marked_fg;
   color_t  gui_marked_bg;
   gchar   *gui_colorized_fg;
@@ -129,7 +123,9 @@ typedef struct _e_prefs {
   gboolean gui_geometry_save_position;
   gboolean gui_geometry_save_size;
   gboolean gui_geometry_save_maximized;
+  gboolean gui_macosx_style;
   console_open_e gui_console_open;
+  guint    gui_recent_df_entries_max;
   guint    gui_recent_files_count_max;
   guint    gui_fileopen_style;
   gchar           *gui_fileopen_dir;
@@ -139,6 +135,8 @@ typedef struct _e_prefs {
   gboolean gui_use_pref_save;
   gchar   *gui_webbrowser;
   gchar   *gui_window_title;
+  gchar   *gui_start_title;
+  gboolean gui_version_in_start_page;
   layout_type_e gui_layout_type;
   layout_pane_content_e gui_layout_content_1;
   layout_pane_content_e gui_layout_content_2;
@@ -147,12 +145,16 @@ typedef struct _e_prefs {
   guint32  name_resolve;
   gint     name_resolve_concurrency;
   gchar   *capture_device;
+  gchar   *capture_devices_linktypes;
   gchar   *capture_devices_descr;
   gchar   *capture_devices_hide;
   gboolean capture_prom_mode;
   gboolean capture_real_time;
   gboolean capture_auto_scroll;
   gboolean capture_show_info;
+  guint    rtp_player_max_visible;
+  guint    tap_update_interval;
+  gboolean display_hidden_proto_items;
 } e_prefs;
 
 WS_VAR_IMPORT e_prefs prefs;
@@ -166,6 +168,15 @@ struct pref_module;
 
 typedef struct pref_module module_t;
 
+/** Sets up memory used by proto routines. Called at program startup */
+extern void prefs_init(void);
+
+/** Reset preferences to default values.  Called at profile change */
+extern void prefs_reset(void);
+
+/** Frees memory used by proto routines. Called at program shutdown */
+extern void prefs_cleanup(void);
+
 /*
  * Register a module that will have preferences.
  * Specify the module under which to register it or NULL to register it
@@ -198,10 +209,10 @@ extern module_t *prefs_register_protocol(int id, void (*apply_cb)(void));
 
 /*
  * Register that a protocol has preferences and group it under a single
- * subtree 
+ * subtree
  */
 #define PREFERENCE_GROUPING
-extern module_t *prefs_register_protocol_subtree(const char *subtree, int id, 
+extern module_t *prefs_register_protocol_subtree(const char *subtree, int id,
                                                 void (*apply_cb)(void));
 
 /*
@@ -216,17 +227,9 @@ extern module_t *prefs_register_protocol_obsolete(int id);
 typedef guint (*module_cb)(module_t *module, gpointer user_data);
 
 /*
- * Call a callback function, with a specified argument, for each module
- * in a list of modules.  If the list is NULL, searches the top-level
- * list in the display tree of modules.
- *
- * Ignores "obsolete" modules; their sole purpose is to allow old
- * preferences for dissectors that no longer have preferences to be
- * silently ignored in preference files.  Does not ignore subtrees,
- * as this can be used when walking the display tree of modules.
+ * Returns TRUE if module has any submodules
  */
-extern guint prefs_module_list_foreach(GList *module_list, module_cb callback,
-    gpointer user_data);
+extern gboolean prefs_module_has_submodules(module_t *module);
 
 /*
  * Call a callback function, with a specified argument, for each module
@@ -238,6 +241,18 @@ extern guint prefs_module_list_foreach(GList *module_list, module_cb callback,
  */
 extern guint prefs_modules_foreach(module_cb callback, gpointer user_data);
 
+/*
+ * Call a callback function, with a specified argument, for each submodule
+ * of specified modules.  If the module is NULL, goes through the top-level
+ * list in the display tree of modules.
+ *
+ * Ignores "obsolete" modules; their sole purpose is to allow old
+ * preferences for dissectors that no longer have preferences to be
+ * silently ignored in preference files.  Does not ignore subtrees,
+ * as this can be used when walking the display tree of modules.
+ */
+extern guint prefs_modules_foreach_submodules(module_t *module, module_cb callback, gpointer user_data);
+
 /*
  * Call the "apply" callback function for each module if any of its
  * preferences have changed, and then clear the flag saying its
@@ -287,6 +302,7 @@ extern void prefs_register_uint_preference(module_t *module, const char *name,
 
 /*
  * Register a preference with an Boolean value.
+ * Note that the name must be in lowercase letters only (underscore allowed).
  */
 extern void prefs_register_bool_preference(module_t *module, const char *name,
     const char *title, const char *description, gboolean *var);
@@ -351,6 +367,14 @@ typedef guint (*pref_cb)(pref_t *pref, gpointer user_data);
 extern guint prefs_pref_foreach(module_t *module, pref_cb callback,
     gpointer user_data);
 
+/* Parse through a list of comma-separated, possibly quoted strings.
+ *  Return a list of the string data.
+ */
+extern GList *prefs_get_string_list(gchar *str);
+
+/* Clear the given list of string data. */
+extern void prefs_clear_string_list(GList *sl);
+
 /*
  * Register all non-dissector modules' preferences.
  */
@@ -401,4 +425,9 @@ typedef enum {
 
 extern prefs_set_pref_e prefs_set_pref(char *prefarg);
 
+/*
+ * Returns TRUE if the given device is hidden
+ */
+extern gboolean prefs_is_capture_device_hidden(const char *name);
+
 #endif /* prefs.h */