Signal error on field values that cannot be safely represented as strings instead...
[obnox/wireshark/wip.git] / color_filters.h
index b9b7d788b8fef5ceebd888fdcea6d316685935ae..a38e17c90613c3c88cc0c03a71f11f43a14f3d46 100644 (file)
@@ -24,6 +24,7 @@
 #ifndef  __COLOR_FILTERS_H__
 #define  __COLOR_FILTERS_H__
 
+#define TEMP_COLOR_PREFIX       "___tmp_color_filter___"
 /** @file
  *  Color filters.
  */
@@ -34,6 +35,7 @@ typedef struct _color_filter {
         gchar     *filter_text;   /* text of the filter expression */
         color_t    bg_color;      /* background color for packets that match */
         color_t    fg_color;      /* foreground color for packets that match */
+       gboolean   disabled;      /* set if the filter is disabled */
        gboolean   selected;      /* set if the filter is selected in the color dialog box */
 
         /* only used inside of color_filters.c */
@@ -48,7 +50,11 @@ typedef struct _color_filter {
 /** Init the color filters (incl. initial read from file). */
 void color_filters_init(void);
 
+/** Reload the color filters */
+void color_filters_reload(void);
 
+/** Cleanup remaining color filter zombies */
+void color_filters_cleanup(void);
 
 /** Color filters currently used?
  *
@@ -56,6 +62,12 @@ void color_filters_init(void);
  */
 gboolean color_filters_used(void);
 
+/** Are there any temporary coloring filters used?
+ *
+ * @return TRUE, if temporary coloring filters are used
+ */
+gboolean tmp_color_filters_used(void);
+
 /** En-/disable color filters
  *
  * @param enable TRUE to enable (default)
@@ -63,7 +75,20 @@ gboolean color_filters_used(void);
 void
 color_filters_enable(gboolean enable);
 
+/** Set the filter string of a temporary color filter
+ *
+ * @param filt_nr a number 1-10 pointing to a temporary color
+ * @param filter the new filter-string
+ * @param disabled whether the filter-rule should be disabled
+ */
+void
+color_filters_set_tmp(guint8 filt_nr, gchar *filter, gboolean disabled);
 
+/** Reset the temporary color filters
+ *
+ */
+void
+color_filters_reset_tmp(void);
 
 /* Prime the epan_dissect_t with all the compiler
  * color filters of the current filter list. 
@@ -116,9 +141,10 @@ void color_filter_add_cb (color_filter_t *colorf, gpointer user_data);
 
 /** Apply a changed filter list.
  *
- * @param cfl the filter list to apply
+ * @param tmp_cfl the temporary color filter list to apply
+ * @param edit_cfl the edited permanent color filter list to apply
  */
-void color_filters_apply(GSList *cfl);
+void color_filters_apply(GSList *tmp_cfl, GSList *edit_cfl);
 
 /** Save filters in users filter file.
  *
@@ -148,7 +174,7 @@ gboolean color_filters_export(gchar *path, GSList *cfl, gboolean only_selected);
  */
 color_filter_t *color_filter_new(
     const gchar *name, const gchar *filter_string,
-    color_t *bg_color, color_t *fg_color);
+    color_t *bg_color, color_t *fg_color, gboolean disabled);
 
 /** Delete a single color filter (g_free'ed).
  *