2 * Definitions for color structures and routines
4 * $Id: colors.h,v 1.5 1999/10/07 22:50:45 guy Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@zing.org>
8 * Copyright 1998 Gerald Combs
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.
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.
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.
38 #define MAX_COLOR_FILTER_NAME_LEN 33
39 #define MAX_COLOR_FILTER_STRING_LEN 256
41 #define CFILTERS_CONTAINS_FILTER(cf) \
42 ((cf)->colors->num_of_filters != 0)
44 extern GdkColor proto_colors[MAXCOLORS];
45 extern GdkColormap* sys_cmap;
46 extern GdkColor color_light_gray;
47 extern GdkColor WHITE;
48 extern GdkColor BLACK;
50 /* This struct is used in the GtkCList which holds the filter information.
51 * The filter name and text string for the filter are the clist data
54 typedef struct _color_filter {
57 dfilter *c_colorfilter;
60 typedef struct _colfilter {
61 GtkWidget *color_filters;
62 gint num_of_filters; /* first num_of_filters rows filled */
63 gint row_selected; /* row in color_filters that is selected */
68 typedef struct _capture_file cap_file;
71 void colors_init(cap_file *cf);
72 void set_color_filter_name(cap_file *cf, gint n, gchar *str);
73 gchar* get_color_filter_name(cap_file *cf, gint n);
75 void set_color_filter_string(cap_file *cf, gint n, gchar *str);
77 gchar* get_color_filter_string(cap_file *cf, gint n);
78 color_filter_t *color_filter(cap_file *cf, gint n);
80 void new_color_filter(colfilter *filters, gchar *name, gchar *filter_string);
82 /* ===================== USER INTERFACE ====================== */
85 color_display_cb(GtkWidget *w, gpointer d);
88 color_delete_cb (GtkWidget *widget,
91 color_cancel_cb (GtkWidget *widget,
94 color_filt_up_cb (GtkButton *button,
98 color_filter_down_cb (GtkButton *button,
102 rembember_selected_row (GtkCList *clist,
109 create_new_cb (GtkButton *button,
113 color_change_cb (GtkButton *button,
117 color_save_cb (GtkButton *button,
121 color_ok_cb (GtkButton *button,
125 color_apply_cb (GtkButton *button,
129 colorize_cancel_cb (GtkObject *object,
133 colorize_fg_cb (GtkButton *button,
137 colorize_bg_cb (GtkButton *button,
141 colorize_ok_cb (GtkButton *button,
145 color_cel_cancel_cb (GtkObject *object,
149 color_sel_ok_cb (GtkButton *button,
153 get_color (GdkColor *new_color);
155 GtkWidget* create_color_win (cap_file *cf);
156 GtkWidget* create_colorize_win (cap_file *cf,
157 GtkWidget **colorize_filter_name,
158 GtkWidget **colorize_filter_text);