[balsa/gtk3] Gtk 3.20 deprecation cleanup
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Gtk 3.20 deprecation cleanup
- Date: Mon, 15 Feb 2016 22:45:47 +0000 (UTC)
commit 48d92020ae051e65889e535986f14ec9b7b7a9d2
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Mon Feb 15 17:45:09 2016 -0500
Gtk 3.20 deprecation cleanup
* libbalsa/mime.c (is_in_url): gtk_text_iter_begins_tag is
deprecated;
* src/balsa-mime-widget-text.c (text_view_url_popup),
(prepare_url_offsets): ditto; also gdk_display_get_device_manager
is deprecated;
* src/main-window.c (bw_notebook_label_new):
gtk_button_set_focus_on_click is deprecated.
ChangeLog | 12 ++++++++++++
libbalsa/mime.c | 5 +++++
src/balsa-mime-widget-text.c | 14 ++++++++++++++
src/main-window.c | 4 ++++
4 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ee40731..ea62fe5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2016-02-15 Peter Bloomfield <pbloomfield bellsouth net>
+
+ Gtk 3.20 deprecation cleanup
+
+ * libbalsa/mime.c (is_in_url): gtk_text_iter_begins_tag is
+ deprecated;
+ * src/balsa-mime-widget-text.c (text_view_url_popup),
+ (prepare_url_offsets): ditto; also gdk_display_get_device_manager
+ is deprecated;
+ * src/main-window.c (bw_notebook_label_new):
+ gtk_button_set_focus_on_click is deprecated.
+
2016-02-15 Albrecht Dreß
Build with Gtk+ < 3.12
diff --git a/libbalsa/mime.c b/libbalsa/mime.c
index 674b608..754fc91 100644
--- a/libbalsa/mime.c
+++ b/libbalsa/mime.c
@@ -660,8 +660,13 @@ static gboolean
is_in_url(GtkTextIter * iter, gint offset, GtkTextTag * url_tag)
{
gtk_text_iter_set_line_offset(iter, offset);
+#if GTK_CHECK_VERSION(3, 19, 0)
+ return url_tag ? (gtk_text_iter_has_tag(iter, url_tag)
+ && !gtk_text_iter_starts_tag(iter, url_tag)) : FALSE;
+#else /* GTK_CHECK_VERSION(3, 20, 0) */
return url_tag ? (gtk_text_iter_has_tag(iter, url_tag)
&& !gtk_text_iter_begins_tag(iter, url_tag)) : FALSE;
+#endif /* GTK_CHECK_VERSION(3, 20, 0) */
}
/* Remove soft newlines and associated quote strings from num_paras
diff --git a/src/balsa-mime-widget-text.c b/src/balsa-mime-widget-text.c
index ea659ba..156b44b 100644
--- a/src/balsa-mime-widget-text.c
+++ b/src/balsa-mime-widget-text.c
@@ -506,7 +506,11 @@ text_view_url_popup(GtkTextView *textview, GtkMenu *menu)
gint x, y;
GdkWindow *window;
GdkDisplay *display;
+#if GTK_CHECK_VERSION(3, 19, 0)
+ GdkSeat *seat;
+#else /* GTK_CHECK_VERSION(3, 20, 0) */
GdkDeviceManager *manager;
+#endif /* GTK_CHECK_VERSION(3, 20, 0) */
GdkDevice *device;
GtkWidget *menu_item;
@@ -517,8 +521,13 @@ text_view_url_popup(GtkTextView *textview, GtkMenu *menu)
/* check if we are over an url */
window = gtk_text_view_get_window(textview, GTK_TEXT_WINDOW_TEXT);
display = gdk_window_get_display(window);
+#if GTK_CHECK_VERSION(3, 19, 0)
+ seat = gdk_display_get_default_seat(display);
+ device = gdk_seat_get_pointer(seat);
+#else /* GTK_CHECK_VERSION(3, 20, 0) */
manager = gdk_display_get_device_manager(display);
device = gdk_device_manager_get_client_pointer(manager);
+#endif /* GTK_CHECK_VERSION(3, 20, 0) */
gdk_window_get_device_position(window, device, &x, &y, NULL);
url = find_url(GTK_WIDGET(textview), x, y, url_list);
@@ -704,8 +713,13 @@ prepare_url_offsets(GtkTextBuffer * buffer, GList * url_list)
gtk_text_iter_backward_to_tag_toggle(&iter, url_tag);
#else
while (gtk_text_iter_backward_char(&iter))
+#if GTK_CHECK_VERSION(3, 19, 0)
+ if (gtk_text_iter_starts_tag(&iter, url_tag))
+ break;
+#else /* GTK_CHECK_VERSION(3, 20, 0) */
if (gtk_text_iter_begins_tag(&iter, url_tag))
break;
+#endif /* GTK_CHECK_VERSION(3, 20, 0) */
#endif /* BUG_102711_FIXED */
url->start = gtk_text_iter_get_offset(&iter);
}
diff --git a/src/main-window.c b/src/main-window.c
index 942192d..6720fb6 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -2838,7 +2838,11 @@ bw_notebook_label_new(BalsaMailboxNode * mbnode)
gtk_box_pack_start(GTK_BOX(box), lab, TRUE, TRUE, 0);
but = gtk_button_new();
+#if GTK_CHECK_VERSION(3, 19, 0)
+ gtk_widget_set_focus_on_click(but, FALSE);
+#else /* GTK_CHECK_VERSION(3, 20, 0) */
gtk_button_set_focus_on_click(GTK_BUTTON(but), FALSE);
+#endif /* GTK_CHECK_VERSION(3, 20, 0) */
gtk_button_set_relief(GTK_BUTTON(but), GTK_RELIEF_NONE);
gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &w, &h);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]