From 8ec5620971b2348ed074e219b8753cc00214221c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 12 Dec 2021 15:54:18 +0200 Subject: [PATCH 43/43] gtk3x: Drop gtk < 3.98.4 compatibility code See osdn #43396 Signed-off-by: Marko Lindqvist --- client/gui-gtk-4.0/gtkcompat.c | 40 ------------------------------ client/gui-gtk-4.0/gtkcompat.h | 45 ---------------------------------- 2 files changed, 85 deletions(-) diff --git a/client/gui-gtk-4.0/gtkcompat.c b/client/gui-gtk-4.0/gtkcompat.c index cd25cf8f60..712fa318eb 100644 --- a/client/gui-gtk-4.0/gtkcompat.c +++ b/client/gui-gtk-4.0/gtkcompat.c @@ -21,46 +21,6 @@ #include "gtkcompat.h" -#if !GTK_CHECK_VERSION(3,98,3) - -/************************************************************************//** - Version of gtk_scrolled_window_set_has_frame() for gtk < 3.98.3 -****************************************************************************/ -void gtk_scrolled_window_set_has_frame(GtkScrolledWindow *wnd, bool shadow) -{ - if (shadow) { - gtk_scrolled_window_set_shadow_type(wnd, GTK_SHADOW_ETCHED_IN); - } else { - gtk_scrolled_window_set_shadow_type(wnd, GTK_SHADOW_NONE); - } -} - -/************************************************************************//** - Version of gtk_button_set_has_frame() for gtk < 3.98.3 -****************************************************************************/ -void gtk_button_set_has_frame(GtkButton *btn, bool shadow) -{ - if (shadow) { - gtk_button_set_relief(btn, GTK_RELIEF_NORMAL); - } else { - gtk_button_set_relief(btn, GTK_RELIEF_NONE); - } -} - -#endif /* GTK version < 3.98.3 */ - -#if !GTK_CHECK_VERSION(3,98,4) - -/************************************************************************//** - Version of gtk_window_destroy() for gtk < 3.98.4 -****************************************************************************/ -void gtk_window_destroy(GtkWindow *wnd) -{ - gtk_widget_destroy(GTK_WIDGET(wnd)); -} - -#endif /* GTK version < 3.98.3 */ - #if !GTK_CHECK_VERSION(3,99,0) /************************************************************************//** diff --git a/client/gui-gtk-4.0/gtkcompat.h b/client/gui-gtk-4.0/gtkcompat.h index c29f9d0f36..8d05b77d2a 100644 --- a/client/gui-gtk-4.0/gtkcompat.h +++ b/client/gui-gtk-4.0/gtkcompat.h @@ -18,51 +18,6 @@ #endif -#if !GTK_CHECK_VERSION(3,98,3) -/* Compatibility mode */ - -#define GDK_ALT_MASK GDK_MOD1_MASK - -void gtk_scrolled_window_set_has_frame(GtkScrolledWindow *wnd, bool shadow); -void gtk_button_set_has_frame(GtkButton *btn, bool shadow); - -#endif /* GTK version < 3.98.3 */ - - -#if !GTK_CHECK_VERSION(3,98,4) - -/* Can't be simple macro, as in some places we need the address of the function. */ -void gtk_window_destroy(GtkWindow *wnd); - -#define gtk_box_append(_box_, _child_) gtk_container_add(GTK_CONTAINER(_box_), _child_) -#define gtk_box_remove(_box_, _child_) gtk_container_remove(GTK_CONTAINER(_box_), _child_) -#define gtk_grid_remove(_grid_, _child_) \ - gtk_container_remove(GTK_CONTAINER(_grid_), _child_) -#define gtk_frame_set_child(_frame_, _child_) \ - gtk_container_add(GTK_CONTAINER(_frame_), _child_) -#define gtk_window_set_child(_win_, _child_) \ - gtk_container_add(GTK_CONTAINER(_win_), _child_) -#define gtk_scrolled_window_set_child(_sw_, _child_) \ - gtk_container_add(GTK_CONTAINER(_sw_), _child_) -#define gtk_combo_box_set_child(_cb_, _child_) \ - gtk_container_add(GTK_CONTAINER(_cb_), _child_) -#define gtk_paned_set_start_child(_paned_, _child_) \ - gtk_paned_pack1(_paned_, _child_, TRUE, TRUE) -#define gtk_paned_set_end_child(_paned_, _child_) \ - gtk_paned_pack2(_paned_, _child_, FALSE, TRUE) -#define gtk_button_set_child(_but_, _child_) \ - gtk_container_add(GTK_CONTAINER(_but_), _child_) - -#define gtk_combo_box_get_child(_box_) \ - gtk_bin_get_child(GTK_BIN(_box_)) -#define gtk_button_get_child(_but_) \ - gtk_bin_get_child(GTK_BIN(_but_)) -#define gtk_window_get_child(_win_) \ - gtk_bin_get_child(GTK_BIN(_win_)) - -#endif /* GTK version < 3.98.4 */ - - #if !GTK_CHECK_VERSION(3,99,0) /* Compatibility mode */ -- 2.33.0