Add stream window color preferences. We don't (yet) use cmaps, so this

may not work with pseudocolor systems.

svn path=/trunk/; revision=1179
This commit is contained in:
Gerald Combs 1999-12-02 04:30:15 +00:00
parent 2478a404c8
commit ee51e6534a
7 changed files with 373 additions and 39 deletions

View File

@ -1,7 +1,7 @@
# Makefile.am
# Automake file for the GTK interface routines for Ethereal
#
# $Id: Makefile.am,v 1.10 1999/11/08 01:03:40 guy Exp $
# $Id: Makefile.am,v 1.11 1999/12/02 04:30:13 gerald Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@zing.org>
@ -57,4 +57,6 @@ libui_a_SOURCES = \
print_prefs.c \
print_prefs.h \
proto_draw.c \
proto_draw.h
proto_draw.h \
stream_prefs.c \
stream_prefs.h

View File

@ -1,6 +1,6 @@
/* main.c
*
* $Id: main.c,v 1.57 1999/11/30 20:50:15 guy Exp $
* $Id: main.c,v 1.58 1999/12/02 04:30:13 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -436,19 +436,17 @@ static void follow_print_stream(GtkWidget *w, gpointer parent_w)
static void
follow_load_text(GtkWidget *text, char *filename, gboolean show_ascii)
{
int bytes_already, bcount;
tcp_stream_chunk sc;
guint32 client_addr = 0;
guint16 client_port = 0;
GdkColor client = { 0, 16383, 0, 0 };
GdkColor server = { 0, 0, 0, 16383 };
int bytes_already, bcount;
tcp_stream_chunk sc;
guint32 client_addr = 0;
guint16 client_port = 0;
/* Delete any info already in text box */
bytes_already = gtk_text_get_length(GTK_TEXT(text));
if (bytes_already > 0) {
gtk_text_set_point(GTK_TEXT(text), 0);
gtk_text_forward_delete(GTK_TEXT(text), bytes_already);
}
/* Delete any info already in text box */
bytes_already = gtk_text_get_length(GTK_TEXT(text));
if (bytes_already > 0) {
gtk_text_set_point(GTK_TEXT(text), 0);
gtk_text_forward_delete(GTK_TEXT(text), bytes_already);
}
/* stop the updates while we fill the text box */
gtk_text_freeze( GTK_TEXT(text) );
@ -478,9 +476,11 @@ follow_load_text(GtkWidget *text, char *filename, gboolean show_ascii)
EBCDIC_to_ASCII(buffer, nchars);
}
if (client_addr == sc.src_addr && client_port == sc.src_port)
gtk_text_insert( GTK_TEXT(text), m_r_font, &client, NULL, buffer, nchars );
gtk_text_insert( GTK_TEXT(text), m_r_font, &prefs.st_client_fg,
&prefs.st_client_bg, buffer, nchars );
else
gtk_text_insert( GTK_TEXT(text), m_r_font, &server, NULL, buffer, nchars );
gtk_text_insert( GTK_TEXT(text), m_r_font, &prefs.st_server_fg,
&prefs.st_server_bg, buffer, nchars );
}
}
if( ferror( data_out_file ) ) {

View File

@ -1,7 +1,7 @@
/* prefs_dlg.c
* Routines for handling preferences
*
* $Id: prefs_dlg.c,v 1.2 1999/09/10 06:53:31 guy Exp $
* $Id: prefs_dlg.c,v 1.3 1999/12/02 04:30:15 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -52,6 +52,7 @@
#include "prefs_dlg.h"
#include "print_prefs.h"
#include "filter_prefs.h"
#include "stream_prefs.h"
#include "util.h"
e_prefs prefs;
@ -65,12 +66,13 @@ static gboolean prefs_main_delete_cb(GtkWidget *, gpointer);
#define E_PRINT_PAGE_KEY "printer_options_page"
#define E_FILTER_PAGE_KEY "filter_options_page"
#define E_COLUMN_PAGE_KEY "column_options_page"
#define E_STREAM_PAGE_KEY "tcp_stream_options_page"
void
prefs_cb(GtkWidget *w, gpointer sp) {
GtkWidget *prefs_w, *main_vb, *top_hb, *bbox, *prefs_nb,
*ok_bt, *save_bt, *cancel_bt;
GtkWidget *print_pg, *filter_pg, *column_pg, *filter_te, *label;
GtkWidget *print_pg, *filter_pg, *column_pg, *stream_pg, *filter_te, *label;
/* GtkWidget *nlabel; */
gint start_page = (gint) sp;
@ -98,13 +100,6 @@ prefs_cb(GtkWidget *w, gpointer sp) {
gtk_container_add(GTK_CONTAINER(main_vb), prefs_nb);
gtk_widget_show(prefs_nb);
/* General prefs */
/* nlabel = gtk_label_new("Nothing here yet...");
gtk_widget_show (nlabel);
label = gtk_label_new ("General");
gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), nlabel, label);
*/
/* Printing prefs */
print_pg = printer_prefs_show();
gtk_object_set_data(GTK_OBJECT(prefs_w), E_PRINT_PAGE_KEY, print_pg);
@ -121,12 +116,19 @@ prefs_cb(GtkWidget *w, gpointer sp) {
gtk_object_set_data(GTK_OBJECT(prefs_w), E_FILTER_PAGE_KEY, filter_pg);
label = gtk_label_new ("Filters");
gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), filter_pg, label);
/* Column prefs */
column_pg = column_prefs_show();
gtk_object_set_data(GTK_OBJECT(prefs_w), E_COLUMN_PAGE_KEY, column_pg);
label = gtk_label_new ("Columns");
gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), column_pg, label);
/* Column prefs */
stream_pg = stream_prefs_show();
gtk_object_set_data(GTK_OBJECT(prefs_w), E_STREAM_PAGE_KEY, stream_pg);
label = gtk_label_new ("TCP Streams");
gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), stream_pg, label);
/* Jump to the specified page, if it was supplied */
if (start_page > E_PR_PG_NONE)
gtk_notebook_set_page(GTK_NOTEBOOK(prefs_nb), start_page);
@ -169,6 +171,7 @@ prefs_main_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
printer_prefs_ok(gtk_object_get_data(GTK_OBJECT(parent_w), E_PRINT_PAGE_KEY));
filter_prefs_ok(gtk_object_get_data(GTK_OBJECT(parent_w), E_FILTER_PAGE_KEY));
column_prefs_ok(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_ok(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
gtk_widget_destroy(GTK_WIDGET(parent_w));
}
@ -178,6 +181,7 @@ prefs_main_save_cb(GtkWidget *save_bt, gpointer parent_w)
printer_prefs_save(gtk_object_get_data(GTK_OBJECT(parent_w), E_PRINT_PAGE_KEY));
filter_prefs_save(gtk_object_get_data(GTK_OBJECT(parent_w), E_FILTER_PAGE_KEY));
column_prefs_save(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_save(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
write_prefs();
}
@ -187,6 +191,7 @@ prefs_main_cancel_cb(GtkWidget *cancel_bt, gpointer parent_w)
printer_prefs_cancel(gtk_object_get_data(GTK_OBJECT(parent_w), E_PRINT_PAGE_KEY));
filter_prefs_cancel(gtk_object_get_data(GTK_OBJECT(parent_w), E_FILTER_PAGE_KEY));
column_prefs_cancel(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_cancel(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
gtk_widget_destroy(GTK_WIDGET(parent_w));
}
@ -196,5 +201,6 @@ prefs_main_delete_cb(GtkWidget *prefs_w, gpointer dummy)
printer_prefs_delete(gtk_object_get_data(GTK_OBJECT(prefs_w), E_PRINT_PAGE_KEY));
filter_prefs_delete(gtk_object_get_data(GTK_OBJECT(prefs_w), E_FILTER_PAGE_KEY));
column_prefs_delete(gtk_object_get_data(GTK_OBJECT(prefs_w), E_COLUMN_PAGE_KEY));
stream_prefs_delete(gtk_object_get_data(GTK_OBJECT(prefs_w), E_STREAM_PAGE_KEY));
return FALSE;
}

226
gtk/stream_prefs.c Normal file
View File

@ -0,0 +1,226 @@
/* stream_prefs.c
* Dialog boxes for preferences for the stream window
*
* $Id: stream_prefs.c,v 1.1 1999/12/02 04:30:15 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
* 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <errno.h>
#ifndef __GLOBALS_H__
#include "globals.h"
#endif
#include "stream_prefs.h"
#ifndef __KEYS_H__
#include "keys.h"
#endif
#ifndef __PRINT_H__
#include "print.h"
#endif
#ifndef __PREFS_DLG_H__
#include "prefs_dlg.h"
#endif
#ifndef __UTIL_H__
#include "util.h"
#endif
static void update_text_color(GtkWidget *, gpointer);
static void update_current_color(GtkWidget *, gpointer);
static void copy_color_vals(GdkColor *, GdkColor *);
static GdkColor tcolors[4], *curcolor = NULL;
#define SAMPLE_CLIENT_TEXT "Sample client text\n"
#define SAMPLE_SERVER_TEXT "Sample server text\n"
#define CFG_IDX 0
#define CBG_IDX 1
#define SFG_IDX 2
#define SBG_IDX 3
#define STREAM_SAMPLE_KEY "stream_entry"
#define STREAM_CS_KEY "stream_colorselection"
#define CS_RED 0
#define CS_GREEN 1
#define CS_BLUE 2
#define CS_OPACITY 3
GtkWidget *
stream_prefs_show()
{
GtkWidget *main_vb, *main_tb, *label, *optmenu, *menu, *menuitem;
GtkWidget *sample, *colorsel;
int width, height, i;
gchar *mt[] = { "Client foreground", "Client background",
"Server foreground", "Server background" };
int mcount = sizeof(mt) / sizeof (gchar *);
gdouble scolor[4];
copy_color_vals(&tcolors[CFG_IDX], &prefs.st_client_fg);
copy_color_vals(&tcolors[CBG_IDX], &prefs.st_client_bg);
copy_color_vals(&tcolors[SFG_IDX], &prefs.st_server_fg);
copy_color_vals(&tcolors[SBG_IDX], &prefs.st_server_bg);
curcolor = &tcolors[CFG_IDX];
scolor[CS_RED] = (gdouble) (curcolor->red) / 65535.0;
scolor[CS_GREEN] = (gdouble) (curcolor->green) / 65535.0;
scolor[CS_BLUE] = (gdouble) (curcolor->blue) / 65535.0;
scolor[CS_OPACITY] = 1.0;
/* Enclosing containers for each row of widgets */
main_vb = gtk_vbox_new(FALSE, 5);
gtk_container_border_width(GTK_CONTAINER(main_vb), 5);
main_tb = gtk_table_new(3, 3, FALSE);
gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
gtk_table_set_row_spacings(GTK_TABLE(main_tb), 10);
gtk_table_set_col_spacings(GTK_TABLE(main_tb), 15);
gtk_widget_show(main_tb);
label = gtk_label_new("Set:");
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
gtk_table_attach_defaults(GTK_TABLE(main_tb), label, 0, 1, 0, 1);
gtk_widget_show(label);
/* We have to create this now, and configure it below. */
colorsel = gtk_color_selection_new();
optmenu = gtk_option_menu_new ();
menu = gtk_menu_new ();
for (i = 0; i < mcount; i++){
menuitem = gtk_menu_item_new_with_label (mt[i]);
gtk_object_set_data(GTK_OBJECT(menuitem), STREAM_CS_KEY,
(gpointer) colorsel);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
GTK_SIGNAL_FUNC(update_current_color), &tcolors[i]);
gtk_widget_show (menuitem);
gtk_menu_append (GTK_MENU (menu), menuitem);
}
gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), menu);
gtk_table_attach_defaults(GTK_TABLE(main_tb), optmenu, 1, 2, 0, 1);
gtk_widget_show(optmenu);
sample = gtk_text_new(FALSE, FALSE);
height = 2 * (sample->style->font->ascent + sample->style->font->descent);
width = gdk_string_width(sample->style->font, "Sample server text");
gtk_widget_set_usize(GTK_WIDGET(sample), width, height);
gtk_text_set_editable(GTK_TEXT(sample), FALSE);
gtk_text_insert(GTK_TEXT(sample), NULL, &tcolors[CFG_IDX], &tcolors[CBG_IDX],
SAMPLE_CLIENT_TEXT, -1);
gtk_text_insert(GTK_TEXT(sample), NULL, &tcolors[SFG_IDX], &tcolors[SBG_IDX],
SAMPLE_SERVER_TEXT, -1);
gtk_table_attach_defaults(GTK_TABLE(main_tb), sample, 2, 3, 0, 2);
gtk_widget_show(sample);
gtk_color_selection_set_color(GTK_COLOR_SELECTION(colorsel), &scolor[CS_RED]);
gtk_table_attach_defaults(GTK_TABLE(main_tb), colorsel, 0, 3, 2, 3);
gtk_object_set_data(GTK_OBJECT(colorsel), STREAM_SAMPLE_KEY,
(gpointer) sample);
gtk_signal_connect(GTK_OBJECT(colorsel), "color-changed",
GTK_SIGNAL_FUNC(update_text_color), NULL);
gtk_widget_show(colorsel);
gtk_widget_show(main_vb);
return(main_vb);
}
static void
update_text_color(GtkWidget *w, gpointer data) {
GtkText *sample = gtk_object_get_data(GTK_OBJECT(w), STREAM_SAMPLE_KEY);
gdouble scolor[4];
gtk_color_selection_get_color(GTK_COLOR_SELECTION(w), &scolor[CS_RED]);
curcolor->red = (gushort) (scolor[CS_RED] * 65535.0);
curcolor->green = (gushort) (scolor[CS_GREEN] * 65535.0);
curcolor->blue = (gushort) (scolor[CS_BLUE] * 65535.0);
gtk_text_freeze(sample);
gtk_text_set_point(sample, 0);
gtk_text_forward_delete(sample, gtk_text_get_length(sample));
gtk_text_insert(sample, NULL, &tcolors[CFG_IDX], &tcolors[CBG_IDX],
SAMPLE_CLIENT_TEXT, -1);
gtk_text_insert(sample, NULL, &tcolors[SFG_IDX], &tcolors[SBG_IDX],
SAMPLE_SERVER_TEXT, -1);
gtk_text_thaw(sample);
}
static void
update_current_color(GtkWidget *w, gpointer data)
{
GtkColorSelection *colorsel = GTK_COLOR_SELECTION(gtk_object_get_data(GTK_OBJECT(w),
STREAM_CS_KEY));
gdouble scolor[4];
curcolor = (GdkColor *) data;
scolor[CS_RED] = (gdouble) (curcolor->red) / 65535.0;
scolor[CS_GREEN] = (gdouble) (curcolor->green) / 65535.0;
scolor[CS_BLUE] = (gdouble) (curcolor->blue) / 65535.0;
scolor[CS_OPACITY] = 1.0;
gtk_color_selection_set_color(colorsel, &scolor[CS_RED]);
}
static void
copy_color_vals(GdkColor *target, GdkColor *source)
{
target->pixel = source->pixel;
target->red = source->red;
target->green = source->green;
target->blue = source->blue;
}
void
stream_prefs_ok(GtkWidget *w)
{
copy_color_vals(&prefs.st_client_fg, &tcolors[CFG_IDX]);
copy_color_vals(&prefs.st_client_bg, &tcolors[CBG_IDX]);
copy_color_vals(&prefs.st_server_fg, &tcolors[SFG_IDX]);
copy_color_vals(&prefs.st_server_bg, &tcolors[SBG_IDX]);
stream_prefs_delete(w);
}
void
stream_prefs_save(GtkWidget *w)
{
stream_prefs_ok(w);
}
void
stream_prefs_cancel(GtkWidget *w)
{
stream_prefs_delete(w);
}
void
stream_prefs_delete(GtkWidget *w)
{
}

31
gtk/stream_prefs.h Normal file
View File

@ -0,0 +1,31 @@
/* stream_prefs.h
* Definitions for stream preferences window
*
* $Id: stream_prefs.h,v 1.1 1999/12/02 04:30:15 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
* Copyright 1999 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
GtkWidget *stream_prefs_show(void);
void stream_prefs_ok(GtkWidget *w);
void stream_prefs_save(GtkWidget *w);
void stream_prefs_cancel(GtkWidget *w);
void stream_prefs_delete(GtkWidget *w);

80
prefs.c
View File

@ -1,7 +1,7 @@
/* prefs.c
* Routines for handling preferences
*
* $Id: prefs.c,v 1.22 1999/09/09 03:31:50 gram Exp $
* $Id: prefs.c,v 1.23 1999/12/02 04:30:03 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -168,6 +168,22 @@ read_prefs(char **pf_path_return) {
prefs.col_list = g_list_append(prefs.col_list, cfmt);
}
prefs.num_cols = DEF_NUM_COLS;
prefs.st_client_fg.pixel = 0;
prefs.st_client_fg.red = 32767;
prefs.st_client_fg.green = 0;
prefs.st_client_fg.blue = 0;
prefs.st_client_bg.pixel = 65535;
prefs.st_client_bg.red = 65535;
prefs.st_client_bg.green = 65535;
prefs.st_client_bg.blue = 65535;
prefs.st_server_fg.pixel = 0;
prefs.st_server_fg.red = 0;
prefs.st_server_fg.green = 0;
prefs.st_server_fg.blue = 32767;
prefs.st_server_bg.pixel = 65535;
prefs.st_server_bg.red = 65535;
prefs.st_server_bg.green = 65535;
prefs.st_server_bg.blue = 65535;
}
if (! pf_path) {
@ -272,11 +288,19 @@ read_prefs(char **pf_path_return) {
return &prefs;
}
#define PRS_PRINT_FMT "print.format"
#define PRS_PRINT_DEST "print.destination"
#define PRS_PRINT_FILE "print.file"
#define PRS_PRINT_CMD "print.command"
#define PRS_COL_FMT "column.format"
#define PRS_PRINT_FMT "print.format"
#define PRS_PRINT_DEST "print.destination"
#define PRS_PRINT_FILE "print.file"
#define PRS_PRINT_CMD "print.command"
#define PRS_COL_FMT "column.format"
#define PRS_STREAM_CL_FG "stream.client.fg"
#define PRS_STREAM_CL_BG "stream.client.bg"
#define PRS_STREAM_SR_FG "stream.server.fg"
#define PRS_STREAM_SR_BG "stream.server.bg"
#define RED_COMPONENT(x) ((((x) >> 16) & 0xff) * 65535 / 255)
#define GREEN_COMPONENT(x) ((((x) >> 8) & 0xff) * 65535 / 255)
#define BLUE_COMPONENT(x) (((x) & 0xff) * 65535 / 255)
static gchar *pr_formats[] = { "text", "postscript" };
static gchar *pr_dests[] = { "command", "file" };
@ -286,6 +310,7 @@ set_pref(gchar *pref, gchar *value) {
GList *col_l;
gint llen;
fmt_data *cfmt;
unsigned long int cval;
if (strcmp(pref, PRS_PRINT_FMT) == 0) {
if (strcmp(value, pr_formats[PR_FMT_TEXT]) == 0) {
@ -332,6 +357,30 @@ set_pref(gchar *pref, gchar *value) {
/* To do: else print some sort of error? */
}
clear_string_list(col_l);
} else if (strcmp(pref, PRS_STREAM_CL_FG) == 0) {
cval = strtoul(value, NULL, 16);
prefs.st_client_fg.pixel = 0;
prefs.st_client_fg.red = RED_COMPONENT(cval);
prefs.st_client_fg.green = GREEN_COMPONENT(cval);
prefs.st_client_fg.blue = BLUE_COMPONENT(cval);
} else if (strcmp(pref, PRS_STREAM_CL_BG) == 0) {
cval = strtoul(value, NULL, 16);
prefs.st_client_bg.pixel = 0;
prefs.st_client_bg.red = RED_COMPONENT(cval);
prefs.st_client_bg.green = GREEN_COMPONENT(cval);
prefs.st_client_bg.blue = BLUE_COMPONENT(cval);
} else if (strcmp(pref, PRS_STREAM_SR_FG) == 0) {
cval = strtoul(value, NULL, 16);
prefs.st_server_fg.pixel = 0;
prefs.st_server_fg.red = RED_COMPONENT(cval);
prefs.st_server_fg.green = GREEN_COMPONENT(cval);
prefs.st_server_fg.blue = BLUE_COMPONENT(cval);
} else if (strcmp(pref, PRS_STREAM_SR_BG) == 0) {
cval = strtoul(value, NULL, 16);
prefs.st_server_bg.pixel = 0;
prefs.st_server_bg.red = RED_COMPONENT(cval);
prefs.st_server_bg.green = GREEN_COMPONENT(cval);
prefs.st_server_bg.blue = BLUE_COMPONENT(cval);
} else {
return 0;
}
@ -396,5 +445,24 @@ write_prefs(void) {
"of a column title \n# and its format.\n"
"%s: %s\n\n", PRS_COL_FMT, col_format_to_pref_str());
fprintf (pf, "# TCP stream window color preferences. Each value is a six "
"digit hexadecimal value in the form rrggbb.\n");
fprintf (pf, "%s: %02x%02x%02x\n", PRS_STREAM_CL_FG,
(prefs.st_client_fg.red * 255 / 65535),
(prefs.st_client_fg.green * 255 / 65535),
(prefs.st_client_fg.blue * 255 / 65535));
fprintf (pf, "%s: %02x%02x%02x\n", PRS_STREAM_CL_BG,
(prefs.st_client_bg.red * 255 / 65535),
(prefs.st_client_bg.green * 255 / 65535),
(prefs.st_client_bg.blue * 255 / 65535));
fprintf (pf, "%s: %02x%02x%02x\n", PRS_STREAM_SR_FG,
(prefs.st_server_fg.red * 255 / 65535),
(prefs.st_server_fg.green * 255 / 65535),
(prefs.st_server_fg.blue * 255 / 65535));
fprintf (pf, "%s: %02x%02x%02x\n", PRS_STREAM_SR_BG,
(prefs.st_server_bg.red * 255 / 65535),
(prefs.st_server_bg.green * 255 / 65535),
(prefs.st_server_bg.blue * 255 / 65535));
fclose(pf);
}

15
prefs.h
View File

@ -1,7 +1,7 @@
/* prefs.h
* Definitions for preference handling routines
*
* $Id: prefs.h,v 1.8 1999/09/09 03:31:50 gram Exp $
* $Id: prefs.h,v 1.9 1999/12/02 04:30:03 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -33,12 +33,13 @@
#define PR_DEST_FILE 1
typedef struct _e_prefs {
gint pr_format;
gint pr_dest;
gchar *pr_file;
gchar *pr_cmd;
GList *col_list;
gint num_cols;
gint pr_format;
gint pr_dest;
gchar *pr_file;
gchar *pr_cmd;
GList *col_list;
gint num_cols;
GdkColor st_client_fg, st_client_bg, st_server_fg, st_server_bg;
} e_prefs;
extern e_prefs prefs;