From b48f39a69b8838eeb89fbc31eb29ed8c4587954f Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 8 Jul 2023 20:53:46 +0300 Subject: [PATCH 20/20] gtk: Drop unused display_color_type See osdn #48297 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.22/colors.c | 28 ---------------------------- client/gui-gtk-3.22/colors.h | 8 +------- client/gui-gtk-3.22/gui_main.c | 6 +----- client/gui-gtk-4.0/colors.c | 8 -------- client/gui-gtk-4.0/colors.h | 8 +------- client/gui-gtk-4.0/gui_main.c | 5 +---- 6 files changed, 4 insertions(+), 59 deletions(-) diff --git a/client/gui-gtk-3.22/colors.c b/client/gui-gtk-3.22/colors.c index 510fd3cd41..705bd3b68f 100644 --- a/client/gui-gtk-3.22/colors.c +++ b/client/gui-gtk-3.22/colors.c @@ -31,34 +31,6 @@ #include "colors.h" -/************************************************************************//** - Get display color type of default visual -****************************************************************************/ -enum Display_color_type get_visual(void) -{ - GdkVisual *visual; - GdkVisualType type; - - visual = gdk_screen_get_system_visual(gdk_screen_get_default()); - type = gdk_visual_get_visual_type(visual); - - if (type == GDK_VISUAL_STATIC_GRAY) { - /* StaticGray, use black and white */ - log_verbose("found B/W display."); - return BW_DISPLAY; - } - - if (type < GDK_VISUAL_STATIC_COLOR) { - /* No color visual available at default depth */ - log_verbose("found grayscale(?) display."); - return GRAYSCALE_DISPLAY; - } - - log_verbose("color system booted ok."); - - return COLOR_DISPLAY; -} - /************************************************************************//** Allocate a color (well, sort of) and return a pointer to it. diff --git a/client/gui-gtk-3.22/colors.h b/client/gui-gtk-3.22/colors.h index aac1f148ef..4007610860 100644 --- a/client/gui-gtk-3.22/colors.h +++ b/client/gui-gtk-3.22/colors.h @@ -22,10 +22,4 @@ struct color { GdkRGBA color; }; -enum Display_color_type { - BW_DISPLAY, GRAYSCALE_DISPLAY, COLOR_DISPLAY -}; - -enum Display_color_type get_visual(void); - -#endif /* FC__COLORS_H */ +#endif /* FC__COLORS_H */ diff --git a/client/gui-gtk-3.22/gui_main.c b/client/gui-gtk-3.22/gui_main.c index 39943071f8..e88d25b793 100644 --- a/client/gui-gtk-3.22/gui_main.c +++ b/client/gui-gtk-3.22/gui_main.c @@ -178,7 +178,6 @@ GtkTextView *main_message_area; GtkTextBuffer *message_buffer = NULL; static GtkWidget *allied_chat_toggle_button; -static enum Display_color_type display_color_type; /* practically unused */ static gint timer_id; /* ditto */ static GIOChannel *srv_channel; static guint srv_id; @@ -1980,12 +1979,9 @@ int ui_main(int argc, char **argv) 0, 0, 0, 0); g_signal_connect(toplevel, "focus", G_CALLBACK(toplevel_focus), NULL); - - display_color_type = get_visual(); - options_iterate(client_optset, poption) { if (OT_FONT == option_type(poption)) { - /* Force to call the appropriated callback. */ + /* Force to call the appropriate callback. */ option_changed(poption); } } options_iterate_end; diff --git a/client/gui-gtk-4.0/colors.c b/client/gui-gtk-4.0/colors.c index 32f3329225..5a914f0db2 100644 --- a/client/gui-gtk-4.0/colors.c +++ b/client/gui-gtk-4.0/colors.c @@ -31,14 +31,6 @@ #include "colors.h" -/************************************************************************//** - Get display color type of default visual -****************************************************************************/ -enum Display_color_type get_visual(void) -{ - return COLOR_DISPLAY; -} - /************************************************************************//** Allocate a color (well, sort of) and return a pointer to it. diff --git a/client/gui-gtk-4.0/colors.h b/client/gui-gtk-4.0/colors.h index aac1f148ef..4007610860 100644 --- a/client/gui-gtk-4.0/colors.h +++ b/client/gui-gtk-4.0/colors.h @@ -22,10 +22,4 @@ struct color { GdkRGBA color; }; -enum Display_color_type { - BW_DISPLAY, GRAYSCALE_DISPLAY, COLOR_DISPLAY -}; - -enum Display_color_type get_visual(void); - -#endif /* FC__COLORS_H */ +#endif /* FC__COLORS_H */ diff --git a/client/gui-gtk-4.0/gui_main.c b/client/gui-gtk-4.0/gui_main.c index 7fcc601d6f..1bb1628194 100644 --- a/client/gui-gtk-4.0/gui_main.c +++ b/client/gui-gtk-4.0/gui_main.c @@ -170,7 +170,6 @@ GtkTextView *main_message_area; GtkTextBuffer *message_buffer = NULL; static GtkWidget *allied_chat_toggle_button; -static enum Display_color_type display_color_type; /* Practically unused */ static gint timer_id; /* Ditto */ static GIOChannel *srv_channel; static guint srv_id; @@ -2006,11 +2005,9 @@ static void activate_gui(GtkApplication *app, gpointer data) 0, 0, 0, 0); g_signal_connect(toplevel, "move-focus", G_CALLBACK(toplevel_focus), NULL); - display_color_type = get_visual(); - options_iterate(client_optset, poption) { if (OT_FONT == option_type(poption)) { - /* Force to call the appropriated callback. */ + /* Force to call the appropriate callback. */ option_changed(poption); } } options_iterate_end; -- 2.40.1