diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-12-31 20:14:08 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-01-01 04:15:29 +0000 |
commit | ee9f102aa9ec36b28992512d840f971be4eba571 (patch) | |
tree | 8251e2c26ba9f6c3680633a03901dd386c3d349d /ui/gtk/color_utils.c | |
parent | 93f9416c3660b87896e8b59a4d952fb851002bb5 (diff) |
No need for toolkit-dependent color initialization.
We're not allocating colors ourselves in GTK+ (and haven't been doing so
since at least 1.12), and all color_t values are valid colors, so
we don't need any toolkit-specific processing to fill in a color_t.
While we're at it, catch read errors when reading color filter files.
Change-Id: Ieb520d141cf15e371a31a01459d466c95ba2209b
Reviewed-on: https://code.wireshark.org/review/12985
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/gtk/color_utils.c')
-rw-r--r-- | ui/gtk/color_utils.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/ui/gtk/color_utils.c b/ui/gtk/color_utils.c index 65889a2fbf..de34afc395 100644 --- a/ui/gtk/color_utils.c +++ b/ui/gtk/color_utils.c @@ -1,5 +1,5 @@ /* color_utils.c - * Toolkit-dependent implementations of routines to handle colors. + * GTK+ color conversion routines. * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> @@ -28,25 +28,6 @@ #include "ui/gtk/color_utils.h" -/* - * Initialize a color with R, G, and B values, including any toolkit-dependent - * work that needs to be done. - * Returns TRUE if it succeeds, FALSE if it fails. - */ -gboolean -initialize_color(color_t *color, guint16 red, guint16 green, guint16 blue) -{ - GdkColor gdk_color; - - gdk_color.pixel = 0; - gdk_color.red = red; - gdk_color.green = green; - gdk_color.blue = blue; - - gdkcolor_to_color_t(color, &gdk_color); - return TRUE; -} - void color_t_to_gdkcolor(GdkColor *target, const color_t *source) { @@ -64,6 +45,7 @@ color_t_to_gdkRGBAcolor(GdkRGBA *target, const color_t *source) target->green = source->green / 65535.0; target->blue = source->blue / 65535.0; } + void gdkcolor_to_color_t(color_t *target, const GdkColor *source) { |