[geany/geany] eed0f3: Remove now dead code guarded with GTK_CHECK_VERSION(3, 0, 0)

Matthew Brush git-noreply at xxxxx
Sat May 29 12:20:42 UTC 2021


Branch:      refs/heads/master
Author:      Matthew Brush <matt at geany.org>
Committer:   Matthew Brush <matt at geany.org>
Date:        Sun, 04 Oct 2020 12:31:01 UTC
Commit:      eed0f3b61a206af37067228b0b09927efc5d269b
             https://github.com/geany/geany/commit/eed0f3b61a206af37067228b0b09927efc5d269b

Log Message:
-----------
Remove now dead code guarded with GTK_CHECK_VERSION(3, 0, 0)


Modified Paths:
--------------
    src/build.c
    src/document.c
    src/editor.c
    src/gb.c
    src/geanywraplabel.c
    src/libmain.c
    src/sidebar.c
    src/socket.c
    src/symbols.c
    src/toolbar.c
    src/ui_utils.c
    src/vte.c

Modified: src/build.c
24 lines changed, 6 insertions(+), 18 deletions(-)
===================================================================
@@ -1733,14 +1733,10 @@ typedef struct RowWidgets
 	gboolean used_dst;
 } RowWidgets;
 
-#if GTK_CHECK_VERSION(3,0,0)
-typedef GdkRGBA InsensitiveColor;
-#else
-typedef GdkColor InsensitiveColor;
-#endif
-static InsensitiveColor insensitive_color;
 
-static void set_row_color(RowWidgets *r, InsensitiveColor *color)
+static GdkRGBA insensitive_color;
+
+static void set_row_color(RowWidgets *r, GdkRGBA *color)
 {
 	enum GeanyBuildCmdEntries i;
 
@@ -1749,11 +1745,7 @@ static void set_row_color(RowWidgets *r, InsensitiveColor *color)
 		if (i == GEANY_BC_LABEL)
 			continue;
 
-#if GTK_CHECK_VERSION(3,0,0)
 		gtk_widget_override_color(r->entries[i], GTK_STATE_FLAG_NORMAL, color);
-#else
-		gtk_widget_modify_text(r->entries[i], GTK_STATE_NORMAL, color);
-#endif
 	}
 }
 
@@ -1866,23 +1858,19 @@ static RowWidgets *build_add_dialog_row(GeanyDocument *doc, GtkTable *table, gui
 	enum GeanyBuildCmdEntries i;
 	guint column = 0;
 	gchar *text;
+	GtkStyleContext *ctx;
 
 	g_return_val_if_fail(doc == NULL || doc->is_valid, NULL);
 
 	text = g_strdup_printf("%d.", cmd + 1);
 	label = gtk_label_new(text);
 	g_free(text);
-#if GTK_CHECK_VERSION(3,0,0)
-{
-	GtkStyleContext *ctx = gtk_widget_get_style_context(label);
 
+	ctx = gtk_widget_get_style_context(label);
 	gtk_style_context_save(ctx);
 	gtk_style_context_get_color(ctx, GTK_STATE_FLAG_INSENSITIVE, &insensitive_color);
 	gtk_style_context_restore(ctx);
-}
-#else
-	insensitive_color = gtk_widget_get_style(label)->text[GTK_STATE_INSENSITIVE];
-#endif
+
 	gtk_table_attach(table, label, column, column + 1, row, row + 1, GTK_FILL,
 		GTK_FILL | GTK_EXPAND, entry_x_padding, entry_y_padding);
 	roww = g_new0(RowWidgets, 1);


Modified: src/document.c
11 lines changed, 0 insertions(+), 11 deletions(-)
===================================================================
@@ -3285,7 +3285,6 @@ const GdkColor *document_get_status_color(GeanyDocument *doc)
 		return NULL;
 	if (! document_status_styles[status].loaded)
 	{
-#if GTK_CHECK_VERSION(3, 0, 0)
 		GdkRGBA color;
 		GtkWidgetPath *path = gtk_widget_path_new();
 		GtkStyleContext *ctx = gtk_style_context_new();
@@ -3303,16 +3302,6 @@ const GdkColor *document_get_status_color(GeanyDocument *doc)
 		document_status_styles[status].loaded = TRUE;
 		gtk_widget_path_unref(path);
 		g_object_unref(ctx);
-#else
-		GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(doc->editor->sci));
-		gchar *path = g_strconcat("GeanyMainWindow.GtkHBox.GtkNotebook.",
-				document_status_styles[status].name, NULL);
-		GtkStyle *style = gtk_rc_get_style_by_paths(settings, path, NULL, GTK_TYPE_LABEL);
-
-		document_status_styles[status].color = style->fg[GTK_STATE_NORMAL];
-		document_status_styles[status].loaded = TRUE;
-		g_free(path);
-#endif
 	}
 	return &document_status_styles[status].color;
 }


Modified: src/editor.c
15 lines changed, 1 insertions(+), 14 deletions(-)
===================================================================
@@ -4796,8 +4796,7 @@ static gboolean on_editor_focus_in(GtkWidget *widget, GdkEventFocus *event, gpoi
 }
 
 
-static gboolean on_editor_expose_event(GtkWidget *widget, GdkEventExpose *event,
-		gpointer user_data)
+static gboolean on_editor_draw(GtkWidget *widget, cairo_t *cr, gpointer user_data)
 {
 	GeanyEditor *editor = user_data;
 
@@ -4808,14 +4807,6 @@ static gboolean on_editor_expose_event(GtkWidget *widget, GdkEventExpose *event,
 }
 
 
-#if GTK_CHECK_VERSION(3, 0, 0)
-static gboolean on_editor_draw(GtkWidget *widget, cairo_t *cr, gpointer user_data)
-{
-	return on_editor_expose_event(widget, NULL, user_data);
-}
-#endif
-
-
 static void setup_sci_keys(ScintillaObject *sci)
 {
 	/* disable some Scintilla keybindings to be able to redefine them cleanly */
@@ -4961,11 +4952,7 @@ static ScintillaObject *create_new_sci(GeanyEditor *editor)
 		g_signal_connect(sci, "scroll-event", G_CALLBACK(on_editor_scroll_event), editor);
 		g_signal_connect(sci, "motion-notify-event", G_CALLBACK(on_motion_event), NULL);
 		g_signal_connect(sci, "focus-in-event", G_CALLBACK(on_editor_focus_in), editor);
-#if GTK_CHECK_VERSION(3, 0, 0)
 		g_signal_connect(sci, "draw", G_CALLBACK(on_editor_draw), editor);
-#else
-		g_signal_connect(sci, "expose-event", G_CALLBACK(on_editor_expose_event), editor);
-#endif
 	}
 	return sci;
 }


Modified: src/gb.c
39 lines changed, 3 insertions(+), 36 deletions(-)
===================================================================
@@ -78,22 +78,14 @@ static GType geany_pong_get_type(void) G_GNUC_CONST;
 G_DEFINE_TYPE(GeanyPong, geany_pong, GTK_TYPE_DIALOG)
 
 
-#if GTK_CHECK_VERSION(3, 0, 0)
 static void geany_pong_set_cairo_source_color(cairo_t *cr, GdkRGBA *c, gdouble a)
 {
 	cairo_set_source_rgba(cr, c->red, c->green, c->blue, MIN(c->alpha, a));
 }
-#else
-static void geany_pong_set_cairo_source_color(cairo_t *cr, GdkColor *c, gdouble a)
-{
-	cairo_set_source_rgba(cr, c->red/65535.0, c->green/65535.0, c->blue/65535.0, a);
-}
-#endif
 
 
 static gboolean geany_pong_area_draw(GtkWidget *area, cairo_t *cr, GeanyPong *self)
 {
-#if GTK_CHECK_VERSION(3, 0, 0)
 	/* we use the window style context because the area one has a transparent
 	 * background and we want something to paint for the overlay */
 	GtkStyleContext *ctx = gtk_widget_get_style_context(GTK_WIDGET(self));
@@ -102,11 +94,6 @@ static gboolean geany_pong_area_draw(GtkWidget *area, cairo_t *cr, GeanyPong *se
 
 	gtk_style_context_get_color(ctx, state, &fg);
 	gtk_style_context_get_background_color(ctx, state, &bg);
-#else
-	GtkStyle *style = gtk_widget_get_style(area);
-	GdkColor fg = style->fg[GTK_STATE_NORMAL];
-	GdkColor bg = style->bg[GTK_STATE_NORMAL];
-#endif
 
 	self->area_width = gtk_widget_get_allocated_width(area);
 	self->area_height = gtk_widget_get_allocated_height(area);
@@ -134,24 +121,22 @@ static gboolean geany_pong_area_draw(GtkWidget *area, cairo_t *cr, GeanyPong *se
 		PangoLayout *layout;
 		gint pw, ph;
 		gdouble scale;
+		PangoFontDescription *font = NULL;
 
 		geany_pong_set_cairo_source_color(cr, &bg, 0.8);
 		cairo_rectangle(cr, 0, 0, self->area_width, self->area_height);
 		cairo_paint(cr);
 
 		geany_pong_set_cairo_source_color(cr, &fg, 1.0);
 		layout = pango_cairo_create_layout(cr);
-#if GTK_CHECK_VERSION(3, 0, 0)
-		PangoFontDescription *font = NULL;
+
 		gtk_style_context_get(ctx, state, GTK_STYLE_PROPERTY_FONT, &font, NULL);
 		if (font)
 		{
 			pango_layout_set_font_description(layout, font);
 			pango_font_description_free(font);
 		}
-#else
-		pango_layout_set_font_description(layout, style->font_desc);
-#endif
+
 		if (! self->handle_width)
 			pango_layout_set_markup(layout, "<b>You won!</b>\n<small>OK, go back to work now.</small>", -1);
 		else
@@ -171,20 +156,6 @@ static gboolean geany_pong_area_draw(GtkWidget *area, cairo_t *cr, GeanyPong *se
 }
 
 
-#if ! GTK_CHECK_VERSION(3, 0, 0)
-static gboolean geany_pong_area_expose(GtkWidget *area, GdkEventExpose *event, GeanyPong *self)
-{
-	cairo_t *cr = gdk_cairo_create(gtk_widget_get_window(area));
-	gboolean ret;
-
-	ret = geany_pong_area_draw(area, cr, self);
-	cairo_destroy(cr);
-
-	return ret;
-}
-#endif
-
-
 static void geany_pong_reset_ball(GeanyPong *self)
 {
 	self->ball_speed = 5;
@@ -365,11 +336,7 @@ static void geany_pong_init(GeanyPong *self)
 
 	self->area = gtk_drawing_area_new();
 	gtk_widget_add_events(self->area, GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK);
-#if GTK_CHECK_VERSION(3, 0, 0)
 	g_signal_connect(self->area, "draw", G_CALLBACK(geany_pong_area_draw), self);
-#else
-	g_signal_connect(self->area, "expose-event", G_CALLBACK(geany_pong_area_expose), self);
-#endif
 	g_signal_connect(self->area, "button-press-event", G_CALLBACK(geany_pong_area_button_press), self);
 	g_signal_connect(self->area, "motion-notify-event", G_CALLBACK(geany_pong_area_motion_notify), self);
 	gtk_widget_set_size_request(self->area, AREA_SIZE, AREA_SIZE);


Modified: src/geanywraplabel.c
46 lines changed, 5 insertions(+), 41 deletions(-)
===================================================================
@@ -48,7 +48,6 @@ struct _GeanyWrapLabel
 };
 
 
-#if GTK_CHECK_VERSION(3, 0, 0)
 static gboolean geany_wrap_label_draw(GtkWidget *widget, cairo_t *cr);
 static void geany_wrap_label_get_preferred_width (GtkWidget *widget,
 		gint *minimal_width, gint *natural_width);
@@ -59,10 +58,7 @@ static void geany_wrap_label_get_preferred_width_for_height (GtkWidget *widget,
 static void geany_wrap_label_get_preferred_height_for_width (GtkWidget *widget,
 		gint width, gint *minimal_height, gint *natural_height);
 static GtkSizeRequestMode geany_wrap_label_get_request_mode(GtkWidget *widget);
-#else
-static gboolean geany_wrap_label_expose		(GtkWidget *widget, GdkEventExpose *event);
-static void geany_wrap_label_size_request	(GtkWidget *widget, GtkRequisition *req);
-#endif
+
 static void geany_wrap_label_size_allocate	(GtkWidget *widget, GtkAllocation *alloc);
 static void geany_wrap_label_set_wrap_width	(GtkWidget *widget, gint width);
 static void geany_wrap_label_label_notify	(GObject *object, GParamSpec *pspec, gpointer data);
@@ -75,17 +71,12 @@ static void geany_wrap_label_class_init(GeanyWrapLabelClass *klass)
 	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
 
 	widget_class->size_allocate = geany_wrap_label_size_allocate;
-#if GTK_CHECK_VERSION(3, 0, 0)
 	widget_class->draw = geany_wrap_label_draw;
 	widget_class->get_preferred_width = geany_wrap_label_get_preferred_width;
 	widget_class->get_preferred_width_for_height = geany_wrap_label_get_preferred_width_for_height;
 	widget_class->get_preferred_height = geany_wrap_label_get_preferred_height;
 	widget_class->get_preferred_height_for_width = geany_wrap_label_get_preferred_height_for_width;
 	widget_class->get_request_mode = geany_wrap_label_get_request_mode;
-#else
-	widget_class->size_request = geany_wrap_label_size_request;
-	widget_class->expose_event = geany_wrap_label_expose;
-#endif
 
 	g_type_class_add_private(klass, sizeof (GeanyWrapLabelPrivate));
 }
@@ -140,7 +131,6 @@ static void geany_wrap_label_label_notify(GObject *object, GParamSpec *pspec, gp
 }
 
 
-#if GTK_CHECK_VERSION(3, 0, 0)
 /* makes sure the layout is setup for rendering and chains to parent renderer */
 static gboolean geany_wrap_label_draw(GtkWidget *widget, cairo_t *cr)
 {
@@ -199,48 +189,22 @@ static GtkSizeRequestMode geany_wrap_label_get_request_mode(GtkWidget *widget)
 	return GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT;
 }
 
-#else /* GTK3 */
-
-/* makes sure the layout is setup for rendering and chains to parent renderer */
-static gboolean geany_wrap_label_expose(GtkWidget *widget, GdkEventExpose *event)
-{
-	GeanyWrapLabel *self = GEANY_WRAP_LABEL(widget);
-	PangoLayout *layout = gtk_label_get_layout(GTK_LABEL(widget));
-
-	pango_layout_set_width(layout, self->priv->wrap_width * PANGO_SCALE);
-	pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
-
-	return (* GTK_WIDGET_CLASS(geany_wrap_label_parent_class)->expose_event)(widget, event);
-}
-
-
-/* Forces the height to be the size necessary for the Pango layout, while allowing the
- * width to be flexible. */
-static void geany_wrap_label_size_request(GtkWidget *widget, GtkRequisition *req)
-{
-	req->width = 0;
-	req->height = GEANY_WRAP_LABEL(widget)->priv->wrap_height;
-}
-#endif /* GTK3 */
-
 
 /* Sets the wrap width to the width allocated to us. */
 static void geany_wrap_label_size_allocate(GtkWidget *widget, GtkAllocation *alloc)
 {
+	GtkWidget *parent;
+
 	(* GTK_WIDGET_CLASS(geany_wrap_label_parent_class)->size_allocate)(widget, alloc);
 
 	geany_wrap_label_set_wrap_width(widget, alloc->width);
 
-#if GTK_CHECK_VERSION(3, 0, 0)
-{
-	/* ask the parent to recompute our size, because it seems GTK3 size
+	/* ask the parent to recompute our size, because it seems GTK size
 	 * caching is too aggressive */
-	GtkWidget *parent = gtk_widget_get_parent(widget);
+	parent = gtk_widget_get_parent(widget);
 	if (GTK_IS_CONTAINER(parent))
 		gtk_container_check_resize(GTK_CONTAINER(parent));
 }
-#endif
-}
 
 
 GtkWidget *geany_wrap_label_new(const gchar *text)


Modified: src/libmain.c
50 lines changed, 1 insertions(+), 49 deletions(-)
===================================================================
@@ -1015,52 +1015,6 @@ static const gchar *get_locale(void)
 }
 
 
-#if ! GTK_CHECK_VERSION(3, 0, 0)
-/* This prepends our own gtkrc file to the list of RC files to be loaded by GTK at startup.
- * This function *has* to be called before gtk_init().
- *
- * We have a custom RC file defining various styles we need, and we want the user to be
- * able to override them (e.g. if they want -- or need -- other colors).  Fair enough, one
- * would simply call gtk_rc_parse() with the appropriate filename.  However, the styling
- * rules applies in the order they are loaded, then if we load our styles after GTK has
- * loaded the user's ones we'd override them.
- *
- * There are 2 solutions to fix this:
- * 1) set our styles' priority to something with lower than "user" (actually "theme"
- *    priority because rules precedence are first calculated depending on the priority
- *    no matter of how precise the rules is, so we need to override the theme).
- * 2) prepend our custom style to GTK's list while keeping priority to user (which is the
- *    default), so it gets loaded before real user's ones and so gets overridden by them.
- *
- * One would normally go for 1 because it's ways simpler and requires less code: you just
- * have to add the priorities to your styles, which is a matter of adding a few ":theme" in
- * the RC file.  However, KDE being a bitch it doesn't set the gtk-theme-name but rather
- * directly includes the style to use in a user gtkrc file, which makes the theme have
- * "user" priority, hence overriding our styles.  So, we cannot set priorities in the RC
- * file if we want to support running under KDE, which pretty much leave us with no choice
- * but to go with solution 2, which unfortunately requires writing ugly code since GTK
- * don't have a gtk_rc_prepend_default_file() function.  Thank you very much KDE.
- *
- * Though, as a side benefit it also makes the code work with people using gtk-chtheme,
- * which also found it funny to include the theme in the user RC file. */
-static void setup_gtk2_styles(void)
-{
-	gchar **gtk_files = gtk_rc_get_default_files();
-	gchar **new_files = g_malloc(sizeof *new_files * (g_strv_length(gtk_files) + 2));
-	guint i = 0;
-
-	new_files[i++] = g_build_filename(app->datadir, "geany.gtkrc", NULL);
-	for (; *gtk_files; gtk_files++)
-		new_files[i++] = g_strdup(*gtk_files);
-	new_files[i] = NULL;
-
-	gtk_rc_set_default_files(new_files);
-
-	g_strfreev(new_files);
-}
-#endif
-
-
 GEANY_EXPORT_SYMBOL
 gint main_lib(gint argc, gchar **argv)
 {
@@ -1088,9 +1042,7 @@ gint main_lib(gint argc, gchar **argv)
 	memset(&ui_widgets, 0, sizeof(UIWidgets));
 
 	setup_paths();
-#if ! GTK_CHECK_VERSION(3, 0, 0)
-	setup_gtk2_styles();
-#endif
+
 #ifdef ENABLE_NLS
 	main_locale_init(utils_resource_dir(RESOURCE_DIR_LOCALE), GETTEXT_PACKAGE);
 #endif


Modified: src/sidebar.c
10 lines changed, 0 insertions(+), 10 deletions(-)
===================================================================
@@ -600,24 +600,14 @@ void sidebar_add_common_menu_items(GtkMenu *menu)
 
 	item = gtk_check_menu_item_new_with_mnemonic(_("Show S_ymbol List"));
 	gtk_container_add(GTK_CONTAINER(menu), item);
-#if GTK_CHECK_VERSION(3, 0, 0)
 	g_signal_connect(item, "draw", G_CALLBACK(on_sidebar_display_symbol_list_show), NULL);
-#else
-	g_signal_connect(item, "expose-event",
-			G_CALLBACK(on_sidebar_display_symbol_list_show), NULL);
-#endif
 	gtk_widget_show(item);
 	g_signal_connect(item, "activate",
 			G_CALLBACK(on_list_symbol_activate), NULL);
 
 	item = gtk_check_menu_item_new_with_mnemonic(_("Show _Document List"));
 	gtk_container_add(GTK_CONTAINER(menu), item);
-#if GTK_CHECK_VERSION(3, 0, 0)
 	g_signal_connect(item, "draw", G_CALLBACK(on_sidebar_display_open_files_show), NULL);
-#else
-	g_signal_connect(item, "expose-event",
-			G_CALLBACK(on_sidebar_display_open_files_show), NULL);
-#endif
 	gtk_widget_show(item);
 	g_signal_connect(item, "activate",
 			G_CALLBACK(on_list_document_activate), NULL);


Modified: src/socket.c
7 lines changed, 0 insertions(+), 7 deletions(-)
===================================================================
@@ -722,12 +722,7 @@ gboolean socket_lock_input_cb(GIOChannel *source, GIOCondition condition, gpoint
 #ifdef G_OS_WIN32
 		else if (strncmp(buf, "window", 6) == 0)
 		{
-#	if GTK_CHECK_VERSION(3, 0, 0)
 			HWND hwnd = (HWND) gdk_win32_window_get_handle(gtk_widget_get_window(window));
-#	else
-			HWND hwnd = (HWND) gdk_win32_drawable_get_handle(
-				GDK_DRAWABLE(gtk_widget_get_window(window)));
-#	endif
 			socket_fd_write(sock, (gchar *)&hwnd, sizeof(hwnd));
 		}
 #endif
@@ -742,9 +737,7 @@ gboolean socket_lock_input_cb(GIOChannel *source, GIOCondition condition, gpoint
 		 * gtk_window_present() really bring the main window into the foreground on some
 		 * window managers like Gnome's metacity.
 		 * Code taken from Gedit. */
-#	if GTK_CHECK_VERSION(3, 0, 0)
 		if (GDK_IS_X11_WINDOW(x11_window))
-#	endif
 		{
 			gdk_x11_window_set_user_time(x11_window, gdk_x11_get_server_time(x11_window));
 		}


Modified: src/symbols.c
4 lines changed, 0 insertions(+), 4 deletions(-)
===================================================================
@@ -1905,11 +1905,7 @@ static void goto_popup_position_func(GtkMenu *menu, gint *x, gint *y, gboolean *
 
 	monitor_num = gdk_screen_get_monitor_at_point(screen, *x, *y);
 
-#if GTK_CHECK_VERSION(3, 0, 0)
 	gtk_widget_get_preferred_size(GTK_WIDGET(menu), NULL, &req);
-#else
-	gtk_widget_size_request(GTK_WIDGET(menu), &req);
-#endif
 
 #if GTK_CHECK_VERSION(3, 4, 0)
 	gdk_screen_get_monitor_workarea(screen, monitor_num, &monitor);


Modified: src/toolbar.c
2 lines changed, 0 insertions(+), 2 deletions(-)
===================================================================
@@ -398,9 +398,7 @@ GtkWidget *toolbar_init(void)
 	gtk_ui_manager_insert_action_group(uim, group, 0);
 
 	toolbar = toolbar_reload(NULL);
-#if GTK_CHECK_VERSION(3, 0, 0)
 	gtk_style_context_add_class(gtk_widget_get_style_context(toolbar), "primary-toolbar");
-#endif
 
 	gtk_settings = gtk_widget_get_settings(GTK_WIDGET(toolbar));
 	if (gtk_settings != NULL)


Modified: src/ui_utils.c
7 lines changed, 0 insertions(+), 7 deletions(-)
===================================================================
@@ -2505,7 +2505,6 @@ void ui_init_builder(void)
 }
 
 
-#if GTK_CHECK_VERSION(3, 0, 0)
 static void load_css_theme(const gchar *fn, guint priority)
 {
 	GtkCssProvider *provider = gtk_css_provider_new();
@@ -2576,15 +2575,11 @@ static void add_css_config_file_item(void)
 	ui_add_config_file_menu_item(theme_fn, NULL, NULL);
 	g_free(theme_fn);
 }
-#endif // GTK3
 
 
 void ui_init(void)
 {
-#if GTK_CHECK_VERSION(3, 0, 0)
 	init_css_styles();
-#endif
-
 	init_recent_files();
 
 	ui_widgets.statusbar = ui_lookup_widget(main_widgets.window, "statusbar");
@@ -2632,9 +2627,7 @@ void ui_init(void)
 	init_document_widgets();
 
 	create_config_files_menu();
-#if GTK_CHECK_VERSION(3, 0, 0)
 	add_css_config_file_item();
-#endif
 }
 
 


Modified: src/vte.c
23 lines changed, 5 insertions(+), 18 deletions(-)
===================================================================
@@ -132,12 +132,11 @@ struct VteFunctions
 	void (*vte_terminal_select_all) (VteTerminal *terminal);
 	void (*vte_terminal_set_audible_bell) (VteTerminal *terminal, gboolean is_audible);
 	GtkAdjustment* (*vte_terminal_get_adjustment) (VteTerminal *terminal);
-#if GTK_CHECK_VERSION(3, 0, 0)
+
 	/* hack for the VTE 2.91 API using GdkRGBA: we wrap the API to keep using GdkColor on our side */
 	void (*vte_terminal_set_color_foreground_rgba) (VteTerminal *terminal, const GdkRGBA *foreground);
 	void (*vte_terminal_set_color_bold_rgba) (VteTerminal *terminal, const GdkRGBA *foreground);
 	void (*vte_terminal_set_color_background_rgba) (VteTerminal *terminal, const GdkRGBA *background);
-#endif
 };
 
 
@@ -183,16 +182,13 @@ static const GtkTargetEntry dnd_targets[] =
 /* replacement for vte_terminal_get_adjustment() when it's not available */
 static GtkAdjustment *default_vte_terminal_get_adjustment(VteTerminal *vte)
 {
-#if GTK_CHECK_VERSION(3, 0, 0)
 	if (GTK_IS_SCROLLABLE(vte))
 		return gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(vte));
-#endif
 	/* this is only valid in < 0.38, 0.38 broke ABI */
 	return vte->adjustment;
 }
 
 
-#if GTK_CHECK_VERSION(3, 0, 0)
 /* Wrap VTE 2.91 API using GdkRGBA with GdkColor so we use a single API on our side */
 
 static void rgba_from_color(GdkRGBA *rgba, const GdkColor *color)
@@ -215,8 +211,7 @@ WRAP_RGBA_SETTER(vte_terminal_set_color_background)
 WRAP_RGBA_SETTER(vte_terminal_set_color_bold)
 WRAP_RGBA_SETTER(vte_terminal_set_color_foreground)
 
-#	undef WRAP_RGBA_SETTER
-#endif
+#undef WRAP_RGBA_SETTER
 
 
 static gchar **vte_get_child_environment(void)
@@ -274,17 +269,12 @@ void vte_init(void)
 	{
 		gint i;
 		const gchar *sonames[] = {
-#if GTK_CHECK_VERSION(3, 0, 0)
-# ifdef __APPLE__
+#ifdef __APPLE__
 			"libvte-2.91.0.dylib", "libvte-2.91.dylib",
 			"libvte2_90.9.dylib", "libvte2_90.dylib",
-# endif
+#else
 			"libvte-2.91.so", "libvte-2.91.so.0",
 			"libvte2_90.so", "libvte2_90.so.9",
-#else /* GTK 2 */
-# ifdef __APPLE__
-			"libvte.9.dylib", "libvte.dylib",
-# endif
 			"libvte.so", "libvte.so.9", "libvte.so.8", "libvte.so.4",
 #endif
 			NULL
@@ -558,7 +548,6 @@ static void vte_set_cursor_blink_mode(void)
 }
 
 
-#if GTK_CHECK_VERSION(3, 0, 0)
 static gboolean vte_is_2_91(void)
 {
 	guint major = vf->vte_get_major_version ? vf->vte_get_major_version() : 0;
@@ -569,7 +558,6 @@ static gboolean vte_is_2_91(void)
 	        /* 0.38 doesn't have runtime version checks, so check a symbol that didn't exist before */
 	        vf->vte_terminal_spawn_sync != NULL);
 }
-#endif
 
 
 static gboolean vte_register_symbols(GModule *mod)
@@ -616,15 +604,14 @@ static gboolean vte_register_symbols(GModule *mod)
 	BIND_REQUIRED_SYMBOL(vte_terminal_get_has_selection);
 	BIND_REQUIRED_SYMBOL(vte_terminal_copy_clipboard);
 	BIND_REQUIRED_SYMBOL(vte_terminal_paste_clipboard);
-#if GTK_CHECK_VERSION(3, 0, 0)
+
 	if (vte_is_2_91())
 	{
 		BIND_REQUIRED_SYMBOL_RGBA_WRAPPED(vte_terminal_set_color_foreground);
 		BIND_REQUIRED_SYMBOL_RGBA_WRAPPED(vte_terminal_set_color_bold);
 		BIND_REQUIRED_SYMBOL_RGBA_WRAPPED(vte_terminal_set_color_background);
 	}
 	else
-#endif
 	{
 		BIND_REQUIRED_SYMBOL(vte_terminal_set_color_foreground);
 		BIND_REQUIRED_SYMBOL(vte_terminal_set_color_bold);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list